Auto merge of #3027 - rex4539:master, r=daira
Fix typos in various files Fix documentation and comment typos.
This commit is contained in:
commit
112ec9886a
|
@ -37,6 +37,6 @@ Run `zcashd --version` to find out
|
|||
This includes the relevant contents of `~/.zcash/debug.log`. You can paste raw text, attach the file directly in the issue or link to the text via a pastebin type site.
|
||||
Please also include any non-standard things you did during compilation (extra flags, dependency version changes etc.) if applicable.
|
||||
|
||||
### Do you have a back up of `~/.zcash` directory and/or take a VM snapshot?
|
||||
### Do you have a backup of `~/.zcash` directory and/or take a VM snapshot?
|
||||
- Backing up / making a copy of the `~/.zcash` directory might help make the problem reproducible. Please redact appropriately.
|
||||
- Taking a VM snapshot is really helpful for interactively testing fixes
|
||||
|
|
|
@ -46,7 +46,7 @@ RPC parameter conventions:
|
|||
|
||||
Command | Parameters | Description
|
||||
--- | --- | ---
|
||||
z_getbalance<br>| address [minconf=1] | Returns the balance of a taddr or zaddr belonging to the node’s wallet.<br><br>Optionally set the minimum number of confirmations a private or transaction transaction must have in order to be included in the balance. Use 0 to count unconfirmed transactions.
|
||||
z_getbalance<br>| address [minconf=1] | Returns the balance of a taddr or zaddr belonging to the node’s wallet.<br><br>Optionally set the minimum number of confirmations a private or transparent transaction must have in order to be included in the balance. Use 0 to count unconfirmed transactions.
|
||||
z_gettotalbalance<br>| [minconf=1] | Return the total value of funds stored in the node’s wallet.<br><br>Optionally set the minimum number of confirmations a private or transparent transaction must have in order to be included in the balance. Use 0 to count unconfirmed transactions.<br><br>Output:<br>{<br>"transparent" : 1.23,<br>"private" : 4.56,<br>"total" : 5.79}
|
||||
|
||||
### Addresses
|
||||
|
@ -72,7 +72,7 @@ Command | Parameters | Description
|
|||
--- | --- | ---
|
||||
z_listreceivedbyaddress<br> | zaddr [minconf=1] | Return a list of amounts received by a zaddr belonging to the node’s wallet.<br><br>Optionally set the minimum number of confirmations which a received amount must have in order to be included in the result. Use 0 to count unconfirmed transactions.<br><br>Output:<br>[{<br>“txid”: “4a0f…”,<br>“amount”: 0.54,<br>“memo”:”F0FF…”,}, {...}, {...}<br>]
|
||||
z_sendmany<br> | fromaddress amounts [minconf=1] [fee=0.0001] | _This is an Asynchronous RPC call_<br><br>Send funds from an address to multiple outputs. The address can be either a taddr or a zaddr.<br><br>Amounts is a list containing key/value pairs corresponding to the addresses and amount to pay. Each output address can be in taddr or zaddr format.<br><br>When sending to a zaddr, you also have the option of attaching a memo in hexadecimal format.<br><br>**NOTE:**When sending coinbase funds to a zaddr, the node's wallet does not allow any change. Put another way, spending a partial amount of a coinbase utxo is not allowed. This is not a consensus rule but a local wallet rule due to the current implementation of z_sendmany. In future, this rule may be removed.<br><br>Example of Outputs parameter:<br>[{“address”:”t123…”, “amount”:0.005},<br>,{“address”:”z010…”,”amount”:0.03, “memo”:”f508af…”}]<br><br>Optionally set the minimum number of confirmations which a private or transparent transaction must have in order to be used as an input. When sending from a zaddr, minconf must be greater than zero.<br><br>Optionally set a transaction fee, which by default is 0.0001 ZEC.<br><br>Any transparent change will be sent to a new transparent address. Any private change will be sent back to the zaddr being used as the source of funds.<br><br>Returns an operationid. You use the operationid value with z_getoperationstatus and z_getoperationresult to obtain the result of sending funds, which if successful, will be a txid.
|
||||
z_shieldcoinbase<br> | fromaddress toaddress [fee=0.0001] [limit=50] | _This is an Asynchronous RPC call_<br><br>Shield transparent coinbase funds by sending to a shielded z address. Utxos selected for shielding will be locked. If there is an error, they are unlocked. The RPC call `listlockunspent` can be used to return a list of locked utxos.<br><br>The number of coinbase utxos selected for shielding can be set with the limit parameter, which has a default value of 50. If the parameter is set to 0, the number of utxos selected is limited by the `-mempooltxinputlimit` option. Any limit is constrained by a consensus rule defining a maximum transaction size of 100000 bytes. <br><br>The from address is a taddr or "*" for all taddrs belonging to the wallet. The to address is a zaddr. The default fee is 0.0001.<br><br>Returns an object containing an operationid which can be used with z_getoperationstatus and z_getoperationresult, along with key-value pairs regarding how many utxos are being shielded in this trasaction and what remains to be shielded.
|
||||
z_shieldcoinbase<br> | fromaddress toaddress [fee=0.0001] [limit=50] | _This is an Asynchronous RPC call_<br><br>Shield transparent coinbase funds by sending to a shielded z address. Utxos selected for shielding will be locked. If there is an error, they are unlocked. The RPC call `listlockunspent` can be used to return a list of locked utxos.<br><br>The number of coinbase utxos selected for shielding can be set with the limit parameter, which has a default value of 50. If the parameter is set to 0, the number of utxos selected is limited by the `-mempooltxinputlimit` option. Any limit is constrained by a consensus rule defining a maximum transaction size of 100000 bytes. <br><br>The from address is a taddr or "*" for all taddrs belonging to the wallet. The to address is a zaddr. The default fee is 0.0001.<br><br>Returns an object containing an operationid which can be used with z_getoperationstatus and z_getoperationresult, along with key-value pairs regarding how many utxos are being shielded in this transaction and what remains to be shielded.
|
||||
|
||||
### Operations
|
||||
|
||||
|
@ -159,7 +159,7 @@ RPC_WALLET_ERROR (-4) | _Unspecified problem with wallet_
|
|||
"Could not find previous JoinSplit anchor" | Try restarting node with `-reindex`.
|
||||
"Error decrypting output note of previous JoinSplit: __" |
|
||||
"Could not find witness for note commitment" | Try restarting node with `-rescan`.
|
||||
"Witness for note commitment is null" | Missing witness for note commitement.
|
||||
"Witness for note commitment is null" | Missing witness for note commitment.
|
||||
"Witness for spendable note does not have same anchor as change input" | Invalid anchor for spendable note witness.
|
||||
"Not enough funds to pay miners fee" | Retry with sufficient funds.
|
||||
"Missing hex data for raw transaction" | Raw transaction data is null.
|
||||
|
|
|
@ -42,7 +42,7 @@ Wallet encryption is disabled, for several reasons:
|
|||
|
||||
You should use full-disk encryption (or encryption of your home directory) to
|
||||
protect your wallet at rest, and should assume (even unprivileged) users who are
|
||||
runnng on your OS can read your wallet.dat file.
|
||||
running on your OS can read your wallet.dat file.
|
||||
|
||||
Side-Channel Attacks
|
||||
--------------------
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
[ZeroMQ](http://zeromq.org/) is a lightweight wrapper around TCP
|
||||
connections, inter-process communication, and shared-memory,
|
||||
providing various message-oriented semantics such as publish/subcribe,
|
||||
providing various message-oriented semantics such as publish/subscribe,
|
||||
request/reply, and push/pull.
|
||||
|
||||
The Zcash daemon can be configured to act as a trusted "border
|
||||
router", implementing the zcash wire protocol and relay, making
|
||||
router", implementing the Zcash wire protocol and relay, making
|
||||
consensus decisions, maintaining the local blockchain database,
|
||||
broadcasting locally generated transactions into the network, and
|
||||
providing a queryable RPC interface to interact on a polled basis for
|
||||
|
@ -102,6 +102,6 @@ and just the tip will be notified. It is up to the subscriber to
|
|||
retrieve the chain from the last known block to the new tip.
|
||||
|
||||
There are several possibilities that ZMQ notification can get lost
|
||||
during transmission depending on the communication type your are
|
||||
during transmission depending on the communication type you are
|
||||
using. Zcashd appends an up-counting sequence number to each
|
||||
notification which allows listeners to detect lost notifications.
|
||||
|
|
|
@ -234,7 +234,7 @@ protected:
|
|||
//! Select an address to connect to, if newOnly is set to true, only the new table is selected from.
|
||||
CAddrInfo Select_(bool newOnly);
|
||||
|
||||
//! Wraps GetRandInt to allow tests to override RandomInt and make it determinismistic.
|
||||
//! Wraps GetRandInt to allow tests to override RandomInt and make it deterministic.
|
||||
virtual int RandomInt(int nMax);
|
||||
|
||||
#ifdef DEBUG_ADDRMAN
|
||||
|
|
|
@ -24,7 +24,7 @@ using namespace std;
|
|||
*
|
||||
* To subclass AsyncRPCOperation, implement the main() method.
|
||||
* Update the operation status as work is underway and completes.
|
||||
* If main() can be interrupted, inmplement the cancel() method.
|
||||
* If main() can be interrupted, implement the cancel() method.
|
||||
*/
|
||||
|
||||
typedef std::string AsyncRPCOperationId;
|
||||
|
|
|
@ -194,7 +194,7 @@ public:
|
|||
K GetKey() {
|
||||
K ret;
|
||||
if (vchData.size() == Size) {
|
||||
//if base58 encouded data not holds a ext key, return a !IsValid() key
|
||||
//if base58 encoded data not holds a ext key, return a !IsValid() key
|
||||
ret.Decode(&vchData[0]);
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -167,7 +167,7 @@ public:
|
|||
nSize += ::GetSerializeSize(VARINT(nCode), nType, nVersion);
|
||||
// spentness bitmask
|
||||
nSize += nMaskSize;
|
||||
// txouts themself
|
||||
// txouts
|
||||
for (unsigned int i = 0; i < vout.size(); i++)
|
||||
if (!vout[i].IsNull())
|
||||
nSize += ::GetSerializeSize(CTxOutCompressor(REF(vout[i])), nType, nVersion);
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Consensus {
|
|||
* Being array indices, these MUST be numbered consecutively.
|
||||
*
|
||||
* The order of these indices MUST match the order of the upgrades on-chain, as
|
||||
* several functions depends on the enum being sorted.
|
||||
* several functions depend on the enum being sorted.
|
||||
*/
|
||||
enum UpgradeIndex {
|
||||
// Sprout must be first
|
||||
|
|
|
@ -118,7 +118,7 @@ TEST(Mempool, TxInputLimit) {
|
|||
// Set a limit
|
||||
mapArgs["-mempooltxinputlimit"] = "10";
|
||||
|
||||
// Check it stil fails as expected
|
||||
// Check it still fails as expected
|
||||
CValidationState state2;
|
||||
EXPECT_FALSE(AcceptToMemoryPool(pool, state2, tx1, false, &missingInputs));
|
||||
EXPECT_EQ(state2.GetRejectReason(), "bad-txns-version-too-low");
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
static const char* WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\"";
|
||||
|
||||
/** Simple one-shot callback timer to be used by the RPC mechanism to e.g.
|
||||
* re-lock the wellet.
|
||||
* re-lock the wallet.
|
||||
*/
|
||||
class HTTPRPCTimer : public RPCTimerBase
|
||||
{
|
||||
|
|
|
@ -332,7 +332,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
|||
const bool showDebug = GetBoolArg("-help-debug", false);
|
||||
|
||||
// When adding new options to the categories, please keep and ensure alphabetical ordering.
|
||||
// Do not translate _(...) -help-debug options, Many technical terms, and only a very small audience, so is unnecessary stress to translators
|
||||
// Do not translate _(...) -help-debug options, many technical terms, and only a very small audience, so is unnecessary stress to translators
|
||||
|
||||
string strUsage = HelpMessageGroup(_("Options:"));
|
||||
strUsage += HelpMessageOpt("-?", _("This help message"));
|
||||
|
|
|
@ -468,7 +468,7 @@ void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<CBl
|
|||
}
|
||||
|
||||
// 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
|
||||
// are not yet downloaded and not in flight to vBlocks. In the meantime, update
|
||||
// pindexLastCommonBlock as long as all ancestors are already downloaded, or if it's
|
||||
// already part of our chain (and therefore don't need it even if pruned).
|
||||
BOOST_FOREACH(CBlockIndex* pindex, vToFetch) {
|
||||
|
@ -2143,7 +2143,7 @@ void PartitionCheck(bool (*initialDownloadCheck)(), CCriticalSection& cs, const
|
|||
while (i->GetBlockTime() >= startTime) {
|
||||
++nBlocks;
|
||||
i = i->pprev;
|
||||
if (i == NULL) return; // Ran out of chain, we must not be fully sync'ed
|
||||
if (i == NULL) return; // Ran out of chain, we must not be fully synced
|
||||
}
|
||||
|
||||
// How likely is it to find that many by chance?
|
||||
|
|
|
@ -62,12 +62,12 @@ CMerkleBlock::CMerkleBlock(const CBlock& block, const std::set<uint256>& txids)
|
|||
|
||||
uint256 CPartialMerkleTree::CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid) {
|
||||
if (height == 0) {
|
||||
// hash at height 0 is the txids themself
|
||||
// hash at height 0 is the txid itself
|
||||
return vTxid[pos];
|
||||
} else {
|
||||
// calculate left hash
|
||||
uint256 left = CalcHash(height-1, pos*2, vTxid), right;
|
||||
// calculate right hash if not beyond the end of the array - copy left hash otherwise1
|
||||
// calculate right hash if not beyond the end of the array - copy left hash otherwise
|
||||
if (pos*2+1 < CalcTreeWidth(height-1))
|
||||
right = CalcHash(height-1, pos*2+1, vTxid);
|
||||
else
|
||||
|
|
|
@ -67,7 +67,7 @@ protected:
|
|||
return (nTransactions+(1 << height)-1) >> height;
|
||||
}
|
||||
|
||||
/** calculate the hash of a node in the merkle tree (at leaf level: the txid's themselves) */
|
||||
/** calculate the hash of a node in the merkle tree (at leaf level: the txid itself) */
|
||||
uint256 CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid);
|
||||
|
||||
/** recursive function that traverses tree nodes, storing the data as bits and hashes */
|
||||
|
|
|
@ -658,7 +658,7 @@ void static BitcoinMiner()
|
|||
equi eq(1);
|
||||
eq.setstate(&curr_state);
|
||||
|
||||
// Intialization done, start algo driver.
|
||||
// Initialization done, start algo driver.
|
||||
eq.digit0(0);
|
||||
eq.xfull = eq.bfull = eq.hfull = 0;
|
||||
eq.showbsizes(0);
|
||||
|
|
|
@ -1074,7 +1074,7 @@ void ThreadSocketHandler()
|
|||
// happens when optimistic write failed, we choose to first drain the
|
||||
// write buffer in this case before receiving more. This avoids
|
||||
// needlessly queueing received data, if the remote peer is not themselves
|
||||
// receiving data. This means properly utilizing TCP flow control signalling.
|
||||
// receiving data. This means properly utilizing TCP flow control signaling.
|
||||
// * Otherwise, if there is no (complete) message in the receive buffer,
|
||||
// or there is space left in the buffer, select() for receiving data.
|
||||
// * (if neither of the above applies, there is certainly one message
|
||||
|
|
|
@ -140,7 +140,7 @@ bool static LookupIntern(const char *pszName, std::vector<CNetAddr>& vIP, unsign
|
|||
return false;
|
||||
|
||||
do {
|
||||
// Should set the timeout limit to a resonable value to avoid
|
||||
// Should set the timeout limit to a reasonable 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.
|
||||
|
|
|
@ -61,7 +61,7 @@ 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 IsRFC2544() const; // IPv4 inter-network communications (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)
|
||||
|
|
|
@ -28,7 +28,7 @@ class CTxMemPoolEntry;
|
|||
* included in blocks before transactions of lower fee/priority. So for
|
||||
* example if you wanted to know what fee you should put on a transaction to
|
||||
* be included in a block within the next 5 blocks, you would start by looking
|
||||
* at the bucket with with the highest fee transactions and verifying that a
|
||||
* at the bucket with the highest fee transactions and verifying that a
|
||||
* sufficiently high percentage of them were confirmed within 5 blocks and
|
||||
* then you would look at the next highest fee bucket, and so on, stopping at
|
||||
* the last bucket to pass the test. The average fee of transactions in this
|
||||
|
@ -71,7 +71,7 @@ static const double DEFAULT_DECAY = .998;
|
|||
|
||||
/**
|
||||
* We will instantiate two instances of this class, one to track transactions
|
||||
* that were included in a block due to fee, and one for tx's included due to
|
||||
* that were included in a block due to fee, and one for txs included due to
|
||||
* priority. We will lump transactions into a bucket according to their approximate
|
||||
* fee or priority and then track how long it took for those txs to be included
|
||||
* in a block. There is always a bucket into which any given double value
|
||||
|
@ -100,7 +100,7 @@ private:
|
|||
// and calcuate the totals for the current block to update the moving averages
|
||||
std::vector<std::vector<int> > curBlockConf; // curBlockConf[Y][X]
|
||||
|
||||
// Sum the total priority/fee of all tx's in each bucket
|
||||
// Sum the total priority/fee of all txs in each bucket
|
||||
// Track the historical moving average of this total over blocks
|
||||
std::vector<double> avg;
|
||||
// and calculate the total for the current block to update the moving average
|
||||
|
@ -217,7 +217,7 @@ static const double FEE_SPACING = 1.1;
|
|||
static const double PRI_SPACING = 2;
|
||||
|
||||
/**
|
||||
* We want to be able to estimate fees or priorities that are needed on tx's to be included in
|
||||
* We want to be able to estimate fees or priorities that are needed on txs to be included in
|
||||
* a certain number of blocks. Every time a block is added to the best chain, this class records
|
||||
* stats on the transactions included in that block
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
// Fix N, K, such that n = N/(k+1) is integer
|
||||
// Fix M = 2^{n+1} hashes each of length N bits,
|
||||
// H_0, ... , H_{M-1}, generated fom (n+1)-bit indices.
|
||||
// H_0, ... , H_{M-1}, generated from (n+1)-bit indices.
|
||||
// Problem: find binary tree on 2^K distinct indices,
|
||||
// for which the exclusive-or of leaf hashes is all 0s.
|
||||
// Additionally, it should satisfy the Wagner conditions:
|
||||
|
|
|
@ -405,7 +405,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_INTERNAL_SERVER_ERROR, "Error: empty request");
|
||||
|
@ -485,7 +485,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
|
|||
if (vOutPoints.size() > MAX_GETUTXOS_OUTPOINTS)
|
||||
return RESTERR(req, HTTP_INTERNAL_SERVER_ERROR, strprintf("Error: max outpoints exceeded (max: %d, tried: %d)", MAX_GETUTXOS_OUTPOINTS, vOutPoints.size()));
|
||||
|
||||
// check spentness and form a bitmap (as well as a JSON capable human-readble string representation)
|
||||
// check spentness and form a bitmap (as well as a JSON capable human-readable string representation)
|
||||
vector<unsigned char> bitmap;
|
||||
vector<CCoin> outs;
|
||||
std::string bitmapStringRepresentation;
|
||||
|
|
|
@ -174,7 +174,7 @@ UniValue getblockcount(const UniValue& params, bool fHelp)
|
|||
if (fHelp || params.size() != 0)
|
||||
throw runtime_error(
|
||||
"getblockcount\n"
|
||||
"\nReturns the number of blocks in the longest block chain.\n"
|
||||
"\nReturns the number of blocks in the best valid block chain.\n"
|
||||
"\nResult:\n"
|
||||
"n (numeric) The current block count\n"
|
||||
"\nExamples:\n"
|
||||
|
@ -530,7 +530,7 @@ UniValue gettxout(const UniValue& params, bool fHelp)
|
|||
"\nArguments:\n"
|
||||
"1. \"txid\" (string, required) The transaction id\n"
|
||||
"2. n (numeric, required) vout value\n"
|
||||
"3. includemempool (boolean, optional) Whether to included the mem pool\n"
|
||||
"3. includemempool (boolean, optional) Whether to include the mempool\n"
|
||||
"\nResult:\n"
|
||||
"{\n"
|
||||
" \"bestblock\" : \"hash\", (string) the block hash\n"
|
||||
|
|
|
@ -142,7 +142,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
|
|||
obj.push_back(Pair("pingwait", stats.dPingWait));
|
||||
obj.push_back(Pair("version", stats.nVersion));
|
||||
// Use the sanitized form of subver here, to avoid tricksy remote peers from
|
||||
// corrupting or modifiying the JSON output by putting special characters in
|
||||
// corrupting or modifying the JSON output by putting special characters in
|
||||
// their ver message.
|
||||
obj.push_back(Pair("subver", stats.cleanSubVer));
|
||||
obj.push_back(Pair("inbound", stats.fInbound));
|
||||
|
|
|
@ -426,7 +426,7 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp)
|
|||
" ]\n"
|
||||
"2. \"addresses\" (string, required) a json object with addresses as keys and amounts as values\n"
|
||||
" {\n"
|
||||
" \"address\": x.xxx (numeric, required) The key is the zcash address, the value is the " + CURRENCY_UNIT + " amount\n"
|
||||
" \"address\": x.xxx (numeric, required) The key is the Zcash address, the value is the " + CURRENCY_UNIT + " amount\n"
|
||||
" ,...\n"
|
||||
" }\n"
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ bool static IsValidSignatureEncoding(const std::vector<unsigned char> &sig) {
|
|||
// excluding the sighash byte.
|
||||
// * R-length: 1-byte length descriptor of the R value that follows.
|
||||
// * R: arbitrary-length big-endian encoded R value. It must use the shortest
|
||||
// possible encoding for a positive integers (which means no null bytes at
|
||||
// possible encoding for a positive integer (which means no null bytes at
|
||||
// the start, except a single one when the next byte has its highest bit set).
|
||||
// * S-length: 1-byte length descriptor of the S value that follows.
|
||||
// * S: arbitrary-length big-endian encoded S value. The same rules apply.
|
||||
|
|
|
@ -139,7 +139,7 @@ const char* GetOpName(opcodetype opcode)
|
|||
case OP_CHECKMULTISIG : return "OP_CHECKMULTISIG";
|
||||
case OP_CHECKMULTISIGVERIFY : return "OP_CHECKMULTISIGVERIFY";
|
||||
|
||||
// expanson
|
||||
// expansion
|
||||
case OP_NOP1 : return "OP_NOP1";
|
||||
case OP_NOP2 : return "OP_NOP2";
|
||||
case OP_NOP3 : return "OP_NOP3";
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
{
|
||||
// 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
|
||||
// Since there can be no more than 20,000 signature operations per block
|
||||
// 50,000 is a reasonable default.
|
||||
int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000);
|
||||
if (nMaxCacheSize <= 0) return;
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
MutableTransactionSignatureCreator(const CKeyStore* keystoreIn, const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amount, int nHashTypeIn) : TransactionSignatureCreator(keystoreIn, &tx, nInIn, amount, nHashTypeIn), tx(*txToIn) {}
|
||||
};
|
||||
|
||||
/** A signature creator that just produces 72-byte empty signatyres. */
|
||||
/** A signature creator that just produces 72-byte empty signatures. */
|
||||
class DummySignatureCreator : public BaseSignatureCreator {
|
||||
public:
|
||||
DummySignatureCreator(const CKeyStore* keystoreIn) : BaseSignatureCreator(keystoreIn) {}
|
||||
|
|
|
@ -14,7 +14,7 @@ Copyright (c) 2012-2014 SCIPR Lab and contributors (see [AUTHORS] file).
|
|||
[TOC]
|
||||
|
||||
<!---
|
||||
NOTE: the file you are reading is in Markdown format, which is is fairly readable
|
||||
NOTE: the file you are reading is in Markdown format, which is fairly readable
|
||||
directly, but can be converted into an HTML file with much nicer formatting.
|
||||
To do so, run "make doc" (this requires the python-markdown package) and view
|
||||
the resulting file README.html. Alternatively, view the latest HTML version at
|
||||
|
@ -84,7 +84,7 @@ The libsnark library currently provides a C++ implementation of:
|
|||
This is easily adapted to any other Random Access Machine that satisfies a
|
||||
simple load-store interface.
|
||||
3. A scalable for TinyRAM using Proof-Carrying Data, as explained in \[BCTV14b]
|
||||
4. Zero-knowldge cluster MapReduce, as explained in \[CTV15].
|
||||
4. Zero-knowledge cluster MapReduce, as explained in \[CTV15].
|
||||
|
||||
The zkSNARK construction implemented by libsnark follows, extends, and
|
||||
optimizes the approach described in \[BCTV14], itself an extension of
|
||||
|
@ -272,7 +272,7 @@ To build just the static library `libsnark.a`, run:
|
|||
$ make lib STATIC=1
|
||||
|
||||
Note that static compilation requires static versions of all libraries it depends on.
|
||||
It may help to minize these dependencies by appending
|
||||
It may help to minimize these dependencies by appending
|
||||
`CURVE=ALT_BN128 NO_PROCPS=1 NO_GTEST=1 NO_SUPERCOP=1`. On Fedora 21, the requisite
|
||||
library RPM dependencies are then:
|
||||
`boost-static glibc-static gmp-static libstdc++-static openssl-static zlib-static
|
||||
|
@ -399,7 +399,7 @@ The following flags change the behavior of the compiled code.
|
|||
* `make MULTICORE=1`
|
||||
|
||||
Enable parallelized execution of the ppzkSNARK generator and prover, using OpenMP.
|
||||
This will utilize all cores on the CPU for heavyweight parallelizabe operations such as
|
||||
This will utilize all cores on the CPU for heavyweight parallelizable operations such as
|
||||
FFT and multiexponentiation. The default is single-core.
|
||||
|
||||
To override the maximum number of cores used, set the environment variable `OMP_NUM_THREADS`
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
a choice of domain S with size ~m that has been selected so to optimize
|
||||
- computations of Lagrange polynomials, and
|
||||
- FFT/iFFT computations.
|
||||
An evaluation domain also provides other other functions, e.g., accessing
|
||||
An evaluation domain also provides other functions, e.g., accessing
|
||||
individual elements in S or evaluating its vanishing polynomial.
|
||||
|
||||
The descriptions below make use of the definition of a *Lagrange polynomial*,
|
||||
|
@ -111,7 +111,7 @@ std::shared_ptr<evaluation_domain<FieldT> > get_evaluation_domain(const size_t m
|
|||
* The inputs are:
|
||||
* - an integer m
|
||||
* - a domain S = (a_{0},...,a_{m-1}) of size m
|
||||
* - a field element element t
|
||||
* - a field element t
|
||||
* - an index idx in {0,...,m-1}
|
||||
* The output is the polynomial L_{idx,S}(z) evaluated at z = t.
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
mp_limb_t data[n] = {0};
|
||||
|
||||
bigint() = default;
|
||||
bigint(const unsigned long x); /// Initalize from a small integer
|
||||
bigint(const unsigned long x); /// Initialize from a small integer
|
||||
bigint(const char* s); /// Initialize from a string containing an integer in decimal notation
|
||||
bigint(const mpz_t r); /// Initialize from MPZ element
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
namespace libsnark {
|
||||
|
||||
template<mp_size_t n>
|
||||
bigint<n>::bigint(const unsigned long x) /// Initalize from a small integer
|
||||
bigint<n>::bigint(const unsigned long x) /// Initialize from a small integer
|
||||
{
|
||||
static_assert(ULONG_MAX <= GMP_NUMB_MAX, "unsigned long does not fit in a GMP limb");
|
||||
this->data[0] = x;
|
||||
|
|
|
@ -34,7 +34,7 @@ std::istream& operator>>(std::istream &, Fp_model<n, modulus> &);
|
|||
* The implementation is mostly a wrapper around GMP's MPN (constant-size integers).
|
||||
* But for the integer sizes of interest for libsnark (3 to 5 limbs of 64 bits each),
|
||||
* we implement performance-critical routines, like addition and multiplication,
|
||||
* using hand-optimzied assembly code.
|
||||
* using hand-optimized assembly code.
|
||||
*/
|
||||
template<mp_size_t n, const bigint<n>& modulus>
|
||||
class Fp_model {
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
/*
|
||||
Split out from multiexp to prevent cyclical
|
||||
dependencies. I.e. previously multiexp dependend on
|
||||
knowledge_commitment, which dependend on sparse_vector, which
|
||||
dependend on multiexp (to do accumulate).
|
||||
dependencies. I.e. previously multiexp depended on
|
||||
knowledge_commitment, which depended on sparse_vector, which
|
||||
depended on multiexp (to do accumulate).
|
||||
|
||||
Will probably go away in more general exp refactoring.
|
||||
*/
|
||||
|
|
|
@ -56,7 +56,7 @@ struct sparse_vector {
|
|||
size_t size() const; // return the number of indices (representing the number of non-zero entries)
|
||||
size_t size_in_bits() const; // return the number bits needed to store the sparse vector
|
||||
|
||||
/* return a pair consisting of the accumulated value and the sparse vector of non-accumuated values */
|
||||
/* return a pair consisting of the accumulated value and the sparse vector of non-accumulated values */
|
||||
template<typename FieldT>
|
||||
std::pair<T, sparse_vector<T> > accumulate(const typename std::vector<FieldT>::const_iterator &it_begin,
|
||||
const typename std::vector<FieldT>::const_iterator &it_end,
|
||||
|
|
|
@ -34,7 +34,7 @@ long long get_nsec_time()
|
|||
return std::chrono::duration_cast<std::chrono::nanoseconds>(timepoint.time_since_epoch()).count();
|
||||
}
|
||||
|
||||
/* Return total CPU time consumsed by all threads of the process, in nanoseconds. */
|
||||
/* Return total CPU time consumed by all threads of the process, in nanoseconds. */
|
||||
long long get_nsec_cpu_time()
|
||||
{
|
||||
::timespec ts;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace libsnark {
|
|||
|
||||
/*
|
||||
* @todo
|
||||
* The serialization is fragile. Shoud be rewritten using a standard, portable-format
|
||||
* The serialization is fragile. Should be rewritten using a standard, portable-format
|
||||
* library like boost::serialize.
|
||||
*
|
||||
* However, for now the following conventions are used within the code.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Declaration of interfaces for a R1CS-to-QAP reduction, that is, constructing
|
||||
a QAP ("Quadratic Arithmetic Program") from a R1CS ("Rank-1 Constraint System").
|
||||
|
||||
QAPs are defined in \[GGPR13], and construced for R1CS also in \[GGPR13].
|
||||
QAPs are defined in \[GGPR13], and constructed for R1CS also in \[GGPR13].
|
||||
|
||||
The implementation of the reduction follows, extends, and optimizes
|
||||
the efficient approach described in Appendix E of \[BCGTV13].
|
||||
|
|
|
@ -43,7 +43,7 @@ class linear_combination;
|
|||
/********************************* Variable **********************************/
|
||||
|
||||
/**
|
||||
* A variable represents a formal expresison of the form "x_{index}".
|
||||
* A variable represents a formal expression of the form "x_{index}".
|
||||
*/
|
||||
template<typename FieldT>
|
||||
class variable {
|
||||
|
|
|
@ -287,7 +287,7 @@ std::istream& operator>>(std::istream &in, r1cs_ppzksnark_proof<ppT> &proof);
|
|||
* A proof for the R1CS ppzkSNARK.
|
||||
*
|
||||
* While the proof has a structure, externally one merely opaquely produces,
|
||||
* seralizes/deserializes, and verifies proofs. We only expose some information
|
||||
* serializes/deserializes, and verifies proofs. We only expose some information
|
||||
* about the structure for statistics purposes.
|
||||
*/
|
||||
template<typename ppT>
|
||||
|
|
|
@ -312,7 +312,7 @@ r1cs_ppzksnark_keypair<ppT> r1cs_ppzksnark_generator(
|
|||
|
||||
const Fr<ppT> rC = rA * rB;
|
||||
|
||||
// consrtuct the same-coefficient-check query (must happen before zeroing out the prefix of At)
|
||||
// construct the same-coefficient-check query (must happen before zeroing out the prefix of At)
|
||||
Fr_vector<ppT> Kt;
|
||||
Kt.reserve(qap_inst.num_variables()+4);
|
||||
for (size_t i = 0; i < qap_inst.num_variables()+1; ++i)
|
||||
|
|
|
@ -145,9 +145,9 @@ private:
|
|||
static void CreateInstance()
|
||||
{
|
||||
// Using a local static instance guarantees that the object is initialized
|
||||
// when it's first needed and also deinitialized after all objects that use
|
||||
// when it's first needed and also destructed after all objects that use
|
||||
// it are done with it. I can think of one unlikely scenario where we may
|
||||
// have a static deinitialization order/problem, but the check in
|
||||
// have a static destruction order/problem, but the check in
|
||||
// LockedPageManagerBase's destructor helps us detect if that ever happens.
|
||||
static LockedPageManager instance;
|
||||
LockedPageManager::_instance = &instance;
|
||||
|
|
|
@ -476,7 +476,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)
|
|||
// this test could be a security issue.
|
||||
BOOST_CHECK(info1.GetNewBucket(nKey1) != info1.GetNewBucket(nKey2));
|
||||
|
||||
// Test 31: Ports should not effect bucket placement in the addr
|
||||
// Test 31: Ports should not affect bucket placement in the addr
|
||||
CAddrInfo info2 = CAddrInfo(addr2, source1);
|
||||
BOOST_CHECK(info1.GetKey() != info2.GetKey());
|
||||
BOOST_CHECK(info1.GetNewBucket(nKey1) == info2.GetNewBucket(nKey1));
|
||||
|
|
|
@ -422,7 +422,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
|||
|
||||
BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey));
|
||||
|
||||
// Neither tx should have make it into the template.
|
||||
// Neither tx should have made it into the template.
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 1);
|
||||
delete pblocktemplate;
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban)
|
|||
BOOST_CHECK(banned_until.get_int64() > now);
|
||||
BOOST_CHECK(banned_until.get_int64()-now <= 200);
|
||||
|
||||
// must throw an exception because 127.0.0.1 is in already banned suubnet range
|
||||
// must throw an exception because 127.0.0.1 is in already banned subnet range
|
||||
BOOST_CHECK_THROW(r = CallRPC(string("setban 127.0.0.1 add")), runtime_error);
|
||||
|
||||
BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0/24 remove")));;
|
||||
|
|
|
@ -155,7 +155,7 @@ namespace tfm = tinyformat;
|
|||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Workaround OSX linker warning: xcode uses different default symbol
|
||||
// Workaround macOS linker warning: Xcode uses different default symbol
|
||||
// visibilities for static libs vs executables (see issue #25)
|
||||
# define TINYFORMAT_HIDDEN __attribute__((visibility("hidden")))
|
||||
#else
|
||||
|
@ -577,7 +577,7 @@ inline const char* printFormatStringLiteral(std::ostream& out, const char* fmt)
|
|||
// Formatting options which can't be natively represented using the ostream
|
||||
// state are returned in spacePadPositive (for space padded positive numbers)
|
||||
// and ntrunc (for truncating conversions). argIndex is incremented if
|
||||
// necessary to pull out variable width and precision . The function returns a
|
||||
// necessary to pull out variable width and precision. The function returns a
|
||||
// pointer to the character after the end of the current format spec.
|
||||
inline const char* streamStateFromFormat(std::ostream& out, bool& spacePadPositive,
|
||||
int& ntrunc, const char* fmtStart,
|
||||
|
|
|
@ -415,7 +415,7 @@ public:
|
|||
TorController(struct event_base* base, const std::string& target);
|
||||
~TorController();
|
||||
|
||||
/** Get name fo file to store private key in */
|
||||
/** Get name for file to store private key in */
|
||||
std::string GetPrivateKeyFile();
|
||||
|
||||
/** Reconnect, after getting disconnected */
|
||||
|
|
|
@ -35,7 +35,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 &&
|
||||
|
@ -51,7 +51,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() &&
|
||||
|
|
|
@ -621,7 +621,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||
{
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
const CWalletTx& wtx = pwalletMain->mapWallet[jso.hash];
|
||||
// Zero confirmaton notes belong to transactions which have not yet been mined
|
||||
// Zero-confirmation notes belong to transactions which have not yet been mined
|
||||
if (mapBlockIndex.find(wtx.hashBlock) == mapBlockIndex.end()) {
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, strprintf("mapBlockIndex does not contain block hash %s", wtx.hashBlock.ToString()));
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ TEST(wallet_tests, find_unspent_notes) {
|
|||
wallet.GetFilteredNotes(entries, "", 2, false);
|
||||
EXPECT_EQ(1, entries.size());
|
||||
entries.clear();
|
||||
// If we also ignore spent notes at thie depth, we won't find any notes.
|
||||
// If we also ignore spent notes at this depth, we won't find any notes.
|
||||
wallet.GetFilteredNotes(entries, "", 2, true);
|
||||
EXPECT_EQ(0, entries.size());
|
||||
entries.clear();
|
||||
|
|
|
@ -411,7 +411,7 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp)
|
|||
"\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. \"zcashaddress\" (string, required) The zcash address to send to.\n"
|
||||
"1. \"zcashaddress\" (string, required) The Zcash address to send to.\n"
|
||||
"2. \"amount\" (numeric, required) The amount in " + CURRENCY_UNIT + " to send. eg 0.1\n"
|
||||
"3. \"comment\" (string, optional) A comment used to store what the transaction is for. \n"
|
||||
" This is not part of the transaction, just kept in your wallet.\n"
|
||||
|
@ -584,7 +584,7 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
|
|||
+ HelpExampleCli("getreceivedbyaddress", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\"") +
|
||||
"\nThe amount including unconfirmed transactions, zero confirmations\n"
|
||||
+ HelpExampleCli("getreceivedbyaddress", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" 0") +
|
||||
"\nThe amount with at least 6 confirmation, very safe\n"
|
||||
"\nThe amount with at least 6 confirmations, very safe\n"
|
||||
+ HelpExampleCli("getreceivedbyaddress", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" 6") +
|
||||
"\nAs a json rpc call\n"
|
||||
+ HelpExampleRpc("getreceivedbyaddress", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", 6")
|
||||
|
@ -886,7 +886,7 @@ UniValue sendfrom(const UniValue& params, bool fHelp)
|
|||
+ HelpRequiringPassphrase() + "\n"
|
||||
"\nArguments:\n"
|
||||
"1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n"
|
||||
"2. \"tozcashaddress\" (string, required) The zcash address to send funds to.\n"
|
||||
"2. \"tozcashaddress\" (string, required) The Zcash address to send funds to.\n"
|
||||
"3. amount (numeric, required) The amount in " + CURRENCY_UNIT + " (transaction fee is added on top).\n"
|
||||
"4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n"
|
||||
"5. \"comment\" (string, optional) A comment used to store what the transaction is for. \n"
|
||||
|
@ -952,7 +952,7 @@ UniValue sendmany(const UniValue& params, bool fHelp)
|
|||
"1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n"
|
||||
"2. \"amounts\" (string, required) A json object with addresses and amounts\n"
|
||||
" {\n"
|
||||
" \"address\":amount (numeric) The zcash address is the key, the numeric amount in " + CURRENCY_UNIT + " is the value\n"
|
||||
" \"address\":amount (numeric) The Zcash address is the key, the numeric amount in " + CURRENCY_UNIT + " is the value\n"
|
||||
" ,...\n"
|
||||
" }\n"
|
||||
"3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.\n"
|
||||
|
@ -2340,7 +2340,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
|
|||
" \"txid\" : \"txid\", (string) the transaction id \n"
|
||||
" \"vout\" : n, (numeric) the vout value\n"
|
||||
" \"generated\" : true|false (boolean) true if txout is a coinbase transaction output\n"
|
||||
" \"address\" : \"address\", (string) the zcash address\n"
|
||||
" \"address\" : \"address\", (string) the Zcash address\n"
|
||||
" \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n"
|
||||
" \"scriptPubKey\" : \"key\", (string) the script key\n"
|
||||
" \"amount\" : x.xxx, (numeric) the transaction amount in " + CURRENCY_UNIT + "\n"
|
||||
|
@ -3455,7 +3455,7 @@ UniValue z_sendmany(const UniValue& params, bool fHelp)
|
|||
if (!memoValue.isNull()) {
|
||||
memo = memoValue.get_str();
|
||||
if (!isZaddr) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Memo can not be used with a taddr. It can only be used with a zaddr.");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Memo cannot be used with a taddr. It can only be used with a zaddr.");
|
||||
} else if (!IsHex(memo)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected memo data in hexadecimal format.");
|
||||
}
|
||||
|
@ -4109,7 +4109,7 @@ UniValue z_listoperationids(const UniValue& params, bool fHelp)
|
|||
"z_listoperationids\n"
|
||||
"\nReturns the list of operation ids currently known to the wallet.\n"
|
||||
"\nArguments:\n"
|
||||
"1. \"status\" (string, optional) Filter result by the operation's state state e.g. \"success\".\n"
|
||||
"1. \"status\" (string, optional) Filter result by the operation's state e.g. \"success\".\n"
|
||||
"\nResult:\n"
|
||||
"[ (json array of string)\n"
|
||||
" \"operationid\" (string) an operation id belonging to the wallet\n"
|
||||
|
|
|
@ -152,7 +152,7 @@ struct COutputEntry
|
|||
int vout;
|
||||
};
|
||||
|
||||
/** An note outpoint */
|
||||
/** A note outpoint */
|
||||
class JSOutPoint
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue