mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
Fixed multiple typos
A few "a->an" and "an->a". "Shows, if the supplied default SOCKS5 proxy" -> "Shows if the supplied default SOCKS5 proxy". Change made on 3 occurrences. "without fully understanding the ramification of a command" -> "without fully understanding the ramifications of a command". Removed duplicate words such as "the the".
This commit is contained in:
parent
c38f540298
commit
0a5a6b90bc
@ -181,5 +181,5 @@ knows what they are getting when installing the GUI package.
|
||||
|
||||
As far as minor differences, I generally prefer to assign the file permissions
|
||||
in the `%files` portion of an RPM spec file rather than specifying the
|
||||
permissions of a file during `%install` and other minor things like that that
|
||||
permissions of a file during `%install` and other minor things like that
|
||||
are largely just cosmetic.
|
||||
|
@ -121,7 +121,7 @@ interface(`bitcoin_manage_lib_dirs',`
|
||||
########################################
|
||||
## <summary>
|
||||
## All of the rules required to administrate
|
||||
## an bitcoin environment
|
||||
## a bitcoin environment
|
||||
## </summary>
|
||||
## <param name="domain">
|
||||
## <summary>
|
||||
|
@ -287,7 +287,7 @@ General C++
|
||||
|
||||
- Assertions should not have side-effects
|
||||
|
||||
- *Rationale*: Even though the source code is set to to refuse to compile
|
||||
- *Rationale*: Even though the source code is set to refuse to compile
|
||||
with assertions disabled, having side-effects in assertions is unexpected and
|
||||
makes the code harder to understand
|
||||
|
||||
|
@ -126,7 +126,7 @@ arith_uint256 GetBlockProof(const CBlockIndex& block)
|
||||
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 arith_uint256. However, as 2**256 is at least as large
|
||||
// as it's too large for an arith_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;
|
||||
|
@ -176,7 +176,7 @@ private:
|
||||
*/
|
||||
mutable std::vector<bool> epoch_flags;
|
||||
|
||||
/** epoch_heuristic_counter is used to determine when a epoch might be aged
|
||||
/** epoch_heuristic_counter is used to determine when an epoch might be aged
|
||||
* & an expensive scan should be done. epoch_heuristic_counter is
|
||||
* decremented on insert and reset to the new number of inserts which would
|
||||
* cause the epoch to reach epoch_size when it reaches zero.
|
||||
@ -184,7 +184,7 @@ private:
|
||||
uint32_t epoch_heuristic_counter;
|
||||
|
||||
/** epoch_size is set to be the number of elements supposed to be in a
|
||||
* epoch. When the number of non-erased elements in a epoch
|
||||
* epoch. When the number of non-erased elements in an epoch
|
||||
* exceeds epoch_size, a new epoch should be started and all
|
||||
* current entries demoted. epoch_size is set to be 45% of size because
|
||||
* we want to keep load around 90%, and we support 3 epochs at once --
|
||||
|
@ -86,7 +86,7 @@ public:
|
||||
|
||||
/**
|
||||
* Get the request header specified by hdr, or an empty string.
|
||||
* Return an pair (isPresent,string).
|
||||
* Return a pair (isPresent,string).
|
||||
*/
|
||||
std::pair<bool, std::string> GetHeader(const std::string& hdr);
|
||||
|
||||
@ -125,7 +125,7 @@ public:
|
||||
virtual ~HTTPClosure() {}
|
||||
};
|
||||
|
||||
/** Event class. This can be used either as an cross-thread trigger or as a timer.
|
||||
/** Event class. This can be used either as a cross-thread trigger or as a timer.
|
||||
*/
|
||||
class HTTPEvent
|
||||
{
|
||||
|
@ -376,7 +376,7 @@ class Compaction {
|
||||
// Each compaction reads inputs from "level_" and "level_+1"
|
||||
std::vector<FileMetaData*> inputs_[2]; // The two sets of inputs
|
||||
|
||||
// State used to check for number of of overlapping grandparent files
|
||||
// State used to check for number of overlapping grandparent files
|
||||
// (parent == level_ + 1, grandparent == level_ + 2)
|
||||
std::vector<FileMetaData*> grandparents_;
|
||||
size_t grandparent_index_; // Index in grandparent_starts_
|
||||
|
@ -48,7 +48,7 @@ class TxConfirmStats;
|
||||
* in each bucket and the total amount of feerate paid in each bucket. Then we
|
||||
* calculate how many blocks Y it took each transaction to be mined. We convert
|
||||
* from a number of blocks to a number of periods Y' each encompassing "scale"
|
||||
* blocks. This is is tracked in 3 different data sets each up to a maximum
|
||||
* blocks. This is tracked in 3 different data sets each up to a maximum
|
||||
* number of periods. Within each data set we have an array of counters in each
|
||||
* feerate bucket and we increment all the counters from Y' up to max periods
|
||||
* representing that a tx was successfully confirmed in less than or equal to
|
||||
|
@ -303,7 +303,7 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, const CB
|
||||
}
|
||||
// if we are in-sync, update the UI regardless of last update time
|
||||
if (!initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
|
||||
//pass a async signal to the UI thread
|
||||
//pass an async signal to the UI thread
|
||||
QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
|
||||
Q_ARG(int, pIndex->nHeight),
|
||||
Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->GetBlockTime())),
|
||||
|
@ -499,7 +499,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
|
||||
{
|
||||
// there is some fudging in these numbers related to the actual virtual transaction size calculation that will keep this estimate from being exact.
|
||||
// usually, the result will be an overestimate within a couple of satoshis so that the confirmation dialog ends up displaying a slightly smaller fee.
|
||||
// also, the witness stack size value value is a variable sized integer. usually, the number of stack items will be well under the single byte var int limit.
|
||||
// also, the witness stack size value is a variable sized integer. usually, the number of stack items will be well under the single byte var int limit.
|
||||
nBytes += 2; // account for the serialized marker and flag bytes
|
||||
nBytes += nQuantity; // account for the witness byte that holds the number of stack items for each input.
|
||||
}
|
||||
|
@ -315,7 +315,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>
|
||||
<string>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -338,7 +338,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>
|
||||
<string>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -361,7 +361,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>
|
||||
<string>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
|
@ -126,7 +126,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||
return;
|
||||
|
||||
// estimate the number of headers left based on nPowTargetSpacing
|
||||
// and check if the gui is not aware of the the best header (happens rarely)
|
||||
// and check if the gui is not aware of the best header (happens rarely)
|
||||
int estimateNumHeadersLeft = bestHeaderDate.secsTo(currentDate) / Params().GetConsensus().nPowTargetSpacing;
|
||||
bool hasBestHeader = bestHeaderHeight >= count;
|
||||
|
||||
|
@ -672,7 +672,7 @@ void RPCConsole::setFontSize(int newSize)
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
//don't allow a insane font size
|
||||
//don't allow an insane font size
|
||||
if (newSize < FONT_RANGE.width() || newSize > FONT_RANGE.height())
|
||||
return;
|
||||
|
||||
@ -738,7 +738,7 @@ void RPCConsole::clear(bool clearHistory)
|
||||
tr("Use up and down arrows to navigate history, and %1 to clear screen.").arg("<b>"+clsKey+"</b>") + "<br>" +
|
||||
tr("Type <b>help</b> for an overview of available commands.")) +
|
||||
"<br><span class=\"secwarning\">" +
|
||||
tr("WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramification of a command.") +
|
||||
tr("WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.") +
|
||||
"</span>",
|
||||
true);
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
|
||||
transaction_array.append(&(ssTx[0]), ssTx.size());
|
||||
}
|
||||
|
||||
// Add addresses / update labels that we've sent to to the address book,
|
||||
// Add addresses / update labels that we've sent to the address book,
|
||||
// and emit coinsSent signal for each recipient
|
||||
for (const SendCoinsRecipient &rcp : transaction.getRecipients())
|
||||
{
|
||||
|
@ -413,7 +413,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
|
||||
boost::split(uriParts, strUriParams, boost::is_any_of("/"));
|
||||
}
|
||||
|
||||
// throw exception in case of a empty request
|
||||
// throw exception in case of an empty request
|
||||
std::string strRequestMutable = req->ReadBody();
|
||||
if (strRequestMutable.length() == 0 && uriParts.size() == 0)
|
||||
return RESTERR(req, HTTP_BAD_REQUEST, "Error: empty request");
|
||||
|
@ -75,7 +75,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
|
||||
"[\n"
|
||||
" {\n"
|
||||
" \"id\": n, (numeric) Peer index\n"
|
||||
" \"addr\":\"host:port\", (string) The ip address and port of the peer\n"
|
||||
" \"addr\":\"host:port\", (string) The IP address and port of the peer\n"
|
||||
" \"addrbind\":\"ip:port\", (string) Bind address of the connection to the peer\n"
|
||||
" \"addrlocal\":\"ip:port\", (string) Local address as reported by the peer\n"
|
||||
" \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n"
|
||||
@ -199,7 +199,7 @@ UniValue addnode(const JSONRPCRequest& request)
|
||||
(strCommand != "onetry" && strCommand != "add" && strCommand != "remove"))
|
||||
throw std::runtime_error(
|
||||
"addnode \"node\" \"add|remove|onetry\"\n"
|
||||
"\nAttempts add or remove a node from the addnode list.\n"
|
||||
"\nAttempts to add or remove a node from the addnode list.\n"
|
||||
"Or try a connection to a node once.\n"
|
||||
"\nArguments:\n"
|
||||
"1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n"
|
||||
@ -290,7 +290,7 @@ UniValue getaddednodeinfo(const JSONRPCRequest& request)
|
||||
"\nResult:\n"
|
||||
"[\n"
|
||||
" {\n"
|
||||
" \"addednode\" : \"192.168.0.201\", (string) The node ip address or name (as provided to addnode)\n"
|
||||
" \"addednode\" : \"192.168.0.201\", (string) The node IP address or name (as provided to addnode)\n"
|
||||
" \"connected\" : true|false, (boolean) If connected\n"
|
||||
" \"addresses\" : [ (list of objects) Only when connected = true\n"
|
||||
" {\n"
|
||||
@ -497,12 +497,12 @@ UniValue setban(const JSONRPCRequest& request)
|
||||
(strCommand != "add" && strCommand != "remove"))
|
||||
throw std::runtime_error(
|
||||
"setban \"subnet\" \"add|remove\" (bantime) (absolute)\n"
|
||||
"\nAttempts add or remove a IP/Subnet from the banned list.\n"
|
||||
"\nAttempts to add or remove an IP/Subnet from the banned list.\n"
|
||||
"\nArguments:\n"
|
||||
"1. \"subnet\" (string, required) The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)\n"
|
||||
"2. \"command\" (string, required) 'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list\n"
|
||||
"3. \"bantime\" (numeric, optional) time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)\n"
|
||||
"4. \"absolute\" (boolean, optional) If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
|
||||
"1. \"subnet\" (string, required) The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)\n"
|
||||
"2. \"command\" (string, required) 'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list\n"
|
||||
"3. \"bantime\" (numeric, optional) time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)\n"
|
||||
"4. \"absolute\" (boolean, optional) If set, the bantime must be an absolute timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
|
||||
"\nExamples:\n"
|
||||
+ HelpExampleCli("setban", "\"192.168.0.6\" \"add\" 86400")
|
||||
+ HelpExampleCli("setban", "\"192.168.0.0/24\" \"add\"")
|
||||
|
@ -3,7 +3,7 @@
|
||||
# to independently set assumptions on input or intermediary variables.
|
||||
#
|
||||
# The general approach is:
|
||||
# * A constraint is a tuple of two sets of of symbolic expressions:
|
||||
# * A constraint is a tuple of two sets of symbolic expressions:
|
||||
# the first of which are required to evaluate to zero, the second of which
|
||||
# are required to evaluate to nonzero.
|
||||
# - A constraint is said to be conflicting if any of its nonzero expressions
|
||||
|
@ -11,7 +11,7 @@ Note:
|
||||
|
||||
- To avoid unnecessary loads and make use of available registers, two
|
||||
'passes' have every time been interleaved, with the odd passes accumulating c' and d'
|
||||
which will be added to c and d respectively in the the even passes
|
||||
which will be added to c and d respectively in the even passes
|
||||
|
||||
*/
|
||||
|
||||
|
@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE( unaryOperators ) // ! ~ -
|
||||
|
||||
|
||||
// Check if doing _A_ _OP_ _B_ results in the same as applying _OP_ onto each
|
||||
// element of Aarray and Barray, and then converting the result into a arith_uint256.
|
||||
// element of Aarray and Barray, and then converting the result into an arith_uint256.
|
||||
#define CHECKBITWISEOPERATOR(_A_,_B_,_OP_) \
|
||||
for (unsigned int i = 0; i < 32; ++i) { TmpArray[i] = _A_##Array[i] _OP_ _B_##Array[i]; } \
|
||||
BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (_A_##L _OP_ _B_##L));
|
||||
|
@ -2506,7 +2506,7 @@
|
||||
],
|
||||
|
||||
["CHECKSEQUENCEVERIFY tests"],
|
||||
["", "CHECKSEQUENCEVERIFY", "CHECKSEQUENCEVERIFY", "INVALID_STACK_OPERATION", "CSV automatically fails on a empty stack"],
|
||||
["", "CHECKSEQUENCEVERIFY", "CHECKSEQUENCEVERIFY", "INVALID_STACK_OPERATION", "CSV automatically fails on an empty stack"],
|
||||
["-1", "CHECKSEQUENCEVERIFY", "CHECKSEQUENCEVERIFY", "NEGATIVE_LOCKTIME", "CSV automatically fails if stack top is negative"],
|
||||
["0x0100", "CHECKSEQUENCEVERIFY", "CHECKSEQUENCEVERIFY,MINIMALDATA", "UNKNOWN_ERROR", "CSV fails if stack top is not minimally encoded"],
|
||||
["0", "CHECKSEQUENCEVERIFY", "CHECKSEQUENCEVERIFY", "UNSATISFIED_LOCKTIME", "CSV fails if stack top bit 1 << 31 is set and the tx version < 2"],
|
||||
|
@ -174,7 +174,7 @@
|
||||
[[["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."],
|
||||
["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 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"],
|
||||
|
@ -407,7 +407,7 @@ static bool WriteBinaryFile(const fs::path &filename, const std::string &data)
|
||||
/****** Bitcoin specific TorController implementation ********/
|
||||
|
||||
/** Controller that connects to Tor control socket, authenticate, then create
|
||||
* and maintain a ephemeral hidden service.
|
||||
* and maintain an ephemeral hidden service.
|
||||
*/
|
||||
class TorController
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ void CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256> &vHashes
|
||||
// accounted for in the state of their ancestors)
|
||||
std::set<uint256> setAlreadyIncluded(vHashesToUpdate.begin(), vHashesToUpdate.end());
|
||||
|
||||
// Iterate in reverse, so that whenever we are looking at at a transaction
|
||||
// Iterate in reverse, so that whenever we are looking at a transaction
|
||||
// we are sure that all in-mempool descendants have already been processed.
|
||||
// This maximizes the benefit of the descendant cache and guarantees that
|
||||
// setMemPoolChildren will be updated, an assumption made in
|
||||
|
@ -437,7 +437,7 @@ bool ParseInt32(const std::string& str, int32_t *out)
|
||||
errno = 0; // strtol will not set errno if valid
|
||||
long int n = strtol(str.c_str(), &endp, 10);
|
||||
if(out) *out = (int32_t)n;
|
||||
// Note that strtol returns a *long int*, so even if strtol doesn't report a over/underflow
|
||||
// Note that strtol returns a *long int*, so even if strtol doesn't report an 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 &&
|
||||
@ -453,7 +453,7 @@ bool ParseInt64(const std::string& str, int64_t *out)
|
||||
errno = 0; // strtoll will not set errno if valid
|
||||
long long int n = strtoll(str.c_str(), &endp, 10);
|
||||
if(out) *out = (int64_t)n;
|
||||
// Note that strtoll returns a *long long int*, so even if strtol doesn't report a over/underflow
|
||||
// Note that strtoll returns a *long long int*, so even if strtol doesn't report an over/underflow
|
||||
// we still have to check that the returned value is within the range of an *int64_t*.
|
||||
return endp && *endp == 0 && !errno &&
|
||||
n >= std::numeric_limits<int64_t>::min() &&
|
||||
@ -470,7 +470,7 @@ bool ParseUInt32(const std::string& str, uint32_t *out)
|
||||
errno = 0; // strtoul will not set errno if valid
|
||||
unsigned long int n = strtoul(str.c_str(), &endp, 10);
|
||||
if(out) *out = (uint32_t)n;
|
||||
// Note that strtoul returns a *unsigned long int*, so even if it doesn't report a over/underflow
|
||||
// Note that strtoul returns a *unsigned long int*, so even if it doesn't report an over/underflow
|
||||
// we still have to check that the returned value is within the range of an *uint32_t*. On 64-bit
|
||||
// platforms the size of these types may be different.
|
||||
return endp && *endp == 0 && !errno &&
|
||||
@ -487,7 +487,7 @@ bool ParseUInt64(const std::string& str, uint64_t *out)
|
||||
errno = 0; // strtoull will not set errno if valid
|
||||
unsigned long long int n = strtoull(str.c_str(), &endp, 10);
|
||||
if(out) *out = (uint64_t)n;
|
||||
// Note that strtoull returns a *unsigned long long int*, so even if it doesn't report a over/underflow
|
||||
// Note that strtoull returns a *unsigned long long int*, so even if it doesn't report an over/underflow
|
||||
// we still have to check that the returned value is within the range of an *uint64_t*.
|
||||
return endp && *endp == 0 && !errno &&
|
||||
n <= std::numeric_limits<uint64_t>::max();
|
||||
|
@ -1206,7 +1206,7 @@ static bool CheckInputs(const CTransaction& tx, CValidationState &state, const C
|
||||
return state.Invalid(false, REJECT_NONSTANDARD, strprintf("non-mandatory-script-verify-flag (%s)", ScriptErrorString(check.GetScriptError())));
|
||||
}
|
||||
// Failures of other flags indicate a transaction that is
|
||||
// invalid in new blocks, e.g. a invalid P2SH. We DoS ban
|
||||
// invalid in new blocks, e.g. an 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
|
||||
|
@ -1049,7 +1049,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
|
||||
" \"redeemscript\": \"<script>\" , (string, optional) Allowed only if the scriptPubKey is a P2SH address or a P2SH scriptPubKey\n"
|
||||
" \"pubkeys\": [\"<pubKey>\", ... ] , (array, optional) Array of strings giving pubkeys that must occur in the output or redeemscript\n"
|
||||
" \"keys\": [\"<key>\", ... ] , (array, optional) Array of strings giving private keys whose corresponding public keys must occur in the output or redeemscript\n"
|
||||
" \"internal\": <true> , (boolean, optional, default: false) Stating whether matching outputs should be be treated as not incoming payments\n"
|
||||
" \"internal\": <true> , (boolean, optional, default: false) Stating whether matching outputs should be treated as not incoming payments\n"
|
||||
" \"watchonly\": <true> , (boolean, optional, default: false) Stating whether matching outputs should be considered watched even when they're not spendable, only allowed if keys are empty\n"
|
||||
" \"label\": <label> , (string, optional, default: '') Label to assign to the address (aka account name, for now), only allowed with internal=false\n"
|
||||
" }\n"
|
||||
|
@ -3866,11 +3866,11 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
|
||||
else if (IsArgSet("-usehd")) {
|
||||
bool useHD = GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET);
|
||||
if (walletInstance->IsHDEnabled() && !useHD) {
|
||||
InitError(strprintf(_("Error loading %s: You can't disable HD on a already existing HD wallet"), walletFile));
|
||||
InitError(strprintf(_("Error loading %s: You can't disable HD on an already existing HD wallet"), walletFile));
|
||||
return NULL;
|
||||
}
|
||||
if (!walletInstance->IsHDEnabled() && useHD) {
|
||||
InitError(strprintf(_("Error loading %s: You can't enable HD on a already existing non-HD wallet"), walletFile));
|
||||
InitError(strprintf(_("Error loading %s: You can't enable HD on an already existing non-HD wallet"), walletFile));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@ -3890,7 +3890,7 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
|
||||
if (chainActive.Tip() && chainActive.Tip() != pindexRescan)
|
||||
{
|
||||
//We can't rescan beyond non-pruned blocks, stop and throw an error
|
||||
//this might happen if a user uses a old wallet within a pruned node
|
||||
//this might happen if a user uses an old wallet within a pruned node
|
||||
// or if he ran -disablewallet for a longer time, then decided to re-enable
|
||||
if (fPruneMode)
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ its preconditions are met, and returns appropriate errors in other cases.
|
||||
This module consists of around a dozen individual test cases implemented in the
|
||||
top-level functions named as test_<test_case_description>. The test functions
|
||||
can be disabled or reordered if needed for debugging. If new test cases are
|
||||
added in the the future, they should try to follow the same convention and not
|
||||
added in the future, they should try to follow the same convention and not
|
||||
make assumptions about execution order.
|
||||
"""
|
||||
|
||||
|
@ -318,7 +318,7 @@ class PruneTest(BitcoinTestFramework):
|
||||
self.start_node(2, self.options.tmpdir, ["-prune=550"])
|
||||
self.log.info("Success")
|
||||
|
||||
# check that wallet loads loads successfully when restarting a pruned node after IBD.
|
||||
# check that wallet loads successfully when restarting a pruned node after IBD.
|
||||
# this was reported to fail in #7494.
|
||||
self.log.info("Syncing node 5 to test wallet")
|
||||
connect_nodes(self.nodes[0], 5)
|
||||
|
@ -82,9 +82,9 @@ class RESTTest (BitcoinTestFramework):
|
||||
n = vout['n']
|
||||
|
||||
|
||||
######################################
|
||||
# GETUTXOS: query a unspent outpoint #
|
||||
######################################
|
||||
#######################################
|
||||
# GETUTXOS: query an unspent outpoint #
|
||||
#######################################
|
||||
json_request = '/checkmempool/'+txid+'-'+str(n)
|
||||
json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')
|
||||
json_obj = json.loads(json_string)
|
||||
@ -97,9 +97,9 @@ class RESTTest (BitcoinTestFramework):
|
||||
assert_equal(json_obj['utxos'][0]['value'], 0.1)
|
||||
|
||||
|
||||
################################################
|
||||
# GETUTXOS: now query a already spent outpoint #
|
||||
################################################
|
||||
#################################################
|
||||
# GETUTXOS: now query an already spent outpoint #
|
||||
#################################################
|
||||
json_request = '/checkmempool/'+vintx+'-0'
|
||||
json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')
|
||||
json_obj = json.loads(json_string)
|
||||
@ -161,24 +161,24 @@ class RESTTest (BitcoinTestFramework):
|
||||
json_request = '/'+txid+'-'+str(n)
|
||||
json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')
|
||||
json_obj = json.loads(json_string)
|
||||
assert_equal(len(json_obj['utxos']), 0) #there should be a outpoint because it has just added to the mempool
|
||||
assert_equal(len(json_obj['utxos']), 0) #there should be an outpoint because it has just added to the mempool
|
||||
|
||||
json_request = '/checkmempool/'+txid+'-'+str(n)
|
||||
json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')
|
||||
json_obj = json.loads(json_string)
|
||||
assert_equal(len(json_obj['utxos']), 1) #there should be a outpoint because it has just added to the mempool
|
||||
assert_equal(len(json_obj['utxos']), 1) #there should be an outpoint because it has just added to the mempool
|
||||
|
||||
#do some invalid requests
|
||||
json_request = '{"checkmempool'
|
||||
response = http_post_call(url.hostname, url.port, '/rest/getutxos'+self.FORMAT_SEPARATOR+'json', json_request, True)
|
||||
assert_equal(response.status, 400) #must be a 400 because we send a invalid json request
|
||||
assert_equal(response.status, 400) #must be a 400 because we send an invalid json request
|
||||
|
||||
json_request = '{"checkmempool'
|
||||
response = http_post_call(url.hostname, url.port, '/rest/getutxos'+self.FORMAT_SEPARATOR+'bin', json_request, True)
|
||||
assert_equal(response.status, 400) #must be a 400 because we send a invalid bin request
|
||||
assert_equal(response.status, 400) #must be a 400 because we send an invalid bin request
|
||||
|
||||
response = http_post_call(url.hostname, url.port, '/rest/getutxos/checkmempool'+self.FORMAT_SEPARATOR+'bin', '', True)
|
||||
assert_equal(response.status, 400) #must be a 400 because we send a invalid bin request
|
||||
assert_equal(response.status, 400) #must be a 400 because we send an invalid bin request
|
||||
|
||||
#test limits
|
||||
json_request = '/checkmempool/'
|
||||
|
@ -10,7 +10,7 @@ from test_framework.script import CScript, OP_1, OP_DROP, OP_2, OP_HASH160, OP_E
|
||||
from test_framework.mininode import CTransaction, CTxIn, CTxOut, COutPoint, ToHex, COIN
|
||||
|
||||
# Construct 2 trivial P2SH's and the ScriptSigs that spend them
|
||||
# So we can create many many transactions without needing to spend
|
||||
# So we can create many transactions without needing to spend
|
||||
# time signing.
|
||||
redeem_script_1 = CScript([OP_1, OP_DROP])
|
||||
redeem_script_2 = CScript([OP_2, OP_DROP])
|
||||
|
@ -61,7 +61,7 @@ mininode_socket_map = dict()
|
||||
|
||||
# One lock for synchronizing all data access between the networking thread (see
|
||||
# NetworkThread below) and the thread running the test logic. For simplicity,
|
||||
# NodeConn acquires this lock whenever delivering a message to to a NodeConnCB,
|
||||
# NodeConn acquires this lock whenever delivering a message to a NodeConnCB,
|
||||
# and whenever adding anything to the send buffer (in send_message()). This
|
||||
# lock should be acquired in the thread running the test logic to synchronize
|
||||
# access to any data shared with the NodeConnCB or NodeConn.
|
||||
|
@ -70,7 +70,7 @@ class ZapWalletTXesTest (BitcoinTestFramework):
|
||||
self.nodes[0] = self.start_node(0,self.options.tmpdir, ["-zapwallettxes=1"])
|
||||
|
||||
assert_raises(JSONRPCException, self.nodes[0].gettransaction, [txid3])
|
||||
#there must be a expection because the unconfirmed wallettx0 must be gone by now
|
||||
#there must be an exception because the unconfirmed wallettx0 must be gone by now
|
||||
|
||||
tx0 = self.nodes[0].gettransaction(txid0)
|
||||
assert_equal(tx0['txid'], txid0) #tx0 (confirmed) must still be available because it was confirmed
|
||||
|
Loading…
Reference in New Issue
Block a user