constants.

This commit is contained in:
Christopher Jeffrey 2016-04-17 15:09:24 -07:00
parent dee60da2e2
commit 0cbc9b7338
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -333,6 +333,8 @@ exports.block = {
/**
* Map of historical blocks which create duplicate transactions hashes.
* @see https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki
* @const {Object}
* @default
*/
exports.bip30 = {
@ -375,40 +377,18 @@ exports.script = {
MAX_OP_RETURN: 80
};
exports.mempool = {};
/**
* Ancestor limit.
* @const {Number}
* Mempool-related constants.
* @enum {Number}
* @default
*/
exports.mempool.ANCESTOR_LIMIT = 25;
/**
* Maximum mempool size in bytes.
* @const {Number}
* @default
*/
exports.mempool.MAX_MEMPOOL_SIZE = 300 << 20;
/**
* The time at which transactions
* fall out of the mempool.
* @const {Number}
* @default
*/
exports.mempool.MEMPOOL_EXPIRY = 72 * 60 * 60;
/**
* Maximum number of orphan transactions.
* @const {Number}
* @default
*/
exports.mempool.MAX_ORPHAN_TX = 100;
exports.mempool = {
ANCESTOR_LIMIT: 25,
MAX_MEMPOOL_SIZE: 300 << 20,
MEMPOOL_EXPIRY: 72 * 60 * 60,
MAX_ORPHAN_TX: 100
};
/**
* Reject codes. Note that `internal` and higher
@ -465,35 +445,18 @@ exports.hd = {
exports.LOCKTIME_THRESHOLD = 500000000;
exports.sequence = {};
/**
* Highest nSequence bit (disables sequence locktimes).
* @const {Number}
*/
exports.sequence.DISABLE_FLAG = (1 << 31) >>> 0;
/**
* @const {Number}
* Sequence locktime-related constants.
* @enum {Number}
* @default
*/
exports.sequence.TYPE_FLAG = 1 << 22;
/**
* @const {Number}
* @default
*/
exports.sequence.GRANULARITY = 9;
/**
* @const {Number}
* @default
*/
exports.sequence.MASK = 0x0000ffff;
exports.sequence = {
DISABLE_FLAG: (1 << 31) >>> 0,
TYPE_FLAG: 1 << 22,
GRANULARITY: 9,
MASK: 0x0000ffff
};
/**
* A hash of all zeroes with a `1` at the
@ -597,8 +560,8 @@ exports.flags.MANDATORY_VERIFY_FLAGS = exports.flags.VERIFY_P2SH;
* @default
*/
exports.flags.STANDARD_VERIFY_FLAGS =
exports.flags.MANDATORY_VERIFY_FLAGS
exports.flags.STANDARD_VERIFY_FLAGS = 0
| exports.flags.MANDATORY_VERIFY_FLAGS
| exports.flags.VERIFY_DERSIG
| exports.flags.VERIFY_STRICTENC
| exports.flags.VERIFY_MINIMALDATA
@ -607,9 +570,9 @@ exports.flags.STANDARD_VERIFY_FLAGS =
| exports.flags.VERIFY_CLEANSTACK
| exports.flags.VERIFY_CHECKLOCKTIMEVERIFY
| exports.flags.VERIFY_LOW_S
| exports.flags.VERIFY_CHECKSEQUENCEVERIFY;
// | exports.flags.VERIFY_WITNESS
// | exports.flags.VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM
| exports.flags.VERIFY_CHECKSEQUENCEVERIFY
| exports.flags.VERIFY_WITNESS
| exports.flags.VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM;
/**
* Consensus locktime flags (used for block validation).
@ -625,8 +588,8 @@ exports.flags.MANDATORY_LOCKTIME_FLAGS = 0;
* @default
*/
exports.flags.STANDARD_LOCKTIME_FLAGS =
exports.flags.VERIFY_SEQUENCE
exports.flags.STANDARD_LOCKTIME_FLAGS = 0
| exports.flags.VERIFY_SEQUENCE
| exports.flags.MEDIAN_TIME_PAST;
/**