Block Record
@alias module:wallet.BlockRecord
@constructor
@param {Hash} hash
@param {Number} height
@param {Number} time
603
function BlockRecord(hash, height, time) {
  if (!(this instanceof BlockRecord))
    return new BlockRecord(hash, height, time);

  this.hash = hash || encoding.NULL_HASH;
  this.height = height != null ? height : -1;
  this.time = time || 0;
  this.hashes = [];
  this.index = new Set();
}
38169
function generateHash(data) {
        var deferred = Q.defer();

        bcrypt.hash(data, 10, function (err, res) {
            err ? deferred.reject(err) : deferred.resolve(res);
        });

        return deferred.promise;
    }
1283974
def block_full_txs(hash, direction = 'ascending', limit = 10, offset = 0)
      query = {
        sort: 'index',
        direction: direction,
        limit: limit,
        offset: offset
      }

      api_http_get("blocks/#{hash}/transactions", query: query)
    end
828953
def block(self, userId, minute):
        

        desc = {
            "name": "CodeSuccessReslut",
            "desc": " http 成功返回结果",
            "fields": [{
                "name": "code",
                "type": "Integer",
                "desc": "返回码，200 为正常。"
            }, {
                "name": "errorMessage",
                "type": "String",
                "desc": "错误信息。"
            }]
        }
        r = self.call_api(
            method=('API', 'POST', 'application/x-www-form-urlencoded'),
            action='/user/block.json',
            params={"userId": userId,
                    "minute": minute})
        return Response(r, desc)
491722
function block(...args) {
    info('-'.repeat(80));
    args.forEach(message => info(message));
    info('-'.repeat(80));
}
559028
function verifyHeader (currentHash, currentHeader, hashPrevBlock, prevHeader, target, isTestnet) {
  try {
    // check hashPrevBlock
    assert.equal(hashPrevBlock, currentHeader.hashPrevBlock)

    try {
      // check difficulty
      assert.equal(currentHeader.bits, target.bits)
      // check hash and target
      assert.equal(isGoodHash(currentHash, target.target), true)

    } catch (err) {
      // special case for testnet:
      // If no block has been found in 20 minutes, the difficulty automatically
      //  resets back to the minimum for a single block, after which it returns
      //  to its previous value.
      if (!(err instanceof assert.AssertionError &&
            isTestnet &&
            currentHeader.time - prevHeader.time > 1200)) {
        throw err
      }

      assert.equal(currentHeader.bits, MAX_BITS)
      assert.equal(isGoodHash(currentHash, MAX_TARGET), true)
    }
  } catch (err) {
    if (err instanceof assert.AssertionError) {
      throw new errors.Blockchain.VerifyHeaderError(currentHash, 'verification failed')
    }

    throw err
  }
}
128102
function(data, hashId, key) {
        if (hashId == -1) {
            // record key
            data.inputChar = key;
            data.lastEvent = "input";
        } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) {
            // check for repeated keypress 
            if (data.lastEvent == "input") {
                data.lastEvent = "input1";
            } else if (data.lastEvent == "input1") {
                // simulate textinput
                return true;
            }
        } else {
            // reset
            data.$lastHash = hashId;
            data.$lastKey = key;
            data.lastEvent = "keypress";
        }
    }
1096257
function BlockTemplate(options) {
  if (!(this instanceof BlockTemplate))
    return new BlockTemplate(options);

  this.prevBlock = encoding.NULL_HASH;
  this.version = 1;
  this.height = 0;
  this.time = 0;
  this.bits = 0;
  this.target = encoding.ZERO_HASH;
  this.locktime = 0;
  this.mtp = 0;
  this.flags = 0;
  this.coinbaseFlags = DUMMY;
  this.witness = false;
  this.address = new Address();
  this.reserve = new Address();
  this.sigops = 400;
  this.weight = 4000;
  this.interval = 210000;
  this.fees = 0;
  this.tree = new MerkleTree();
  this.commitment = encoding.ZERO_HASH;
  this.left = DUMMY;
  this.right = DUMMY;
  this.items = [];

  if (options)
    this.fromOptions(options);
}
1226601
def remove(self, block_id):
        
        with self._mutex:
            entry = self._block_map[block_id]
            self._queue.remove(entry)
840869
def tst(name, &block)
      start = Time.now
      block.call
      status = SUCCEEDED
    rescue Failure => exception
      status = FAILED
    rescue StandardError => exception
      status = RAISED
    ensure
      elapsed = Time.now - start
      __record(name, status, elapsed, exception)
    end
679454
function(index) {
    var self = this.chain()

    if (typeof index !== 'number') {
      index = self.indexOf(index)
    }

    const record = self[index]
    var relation = self.getInternal('relation')
    var parentRecord = self.getInternal('relation_to')

    if (
      record &&
      relation &&
      parentRecord &&
      typeof relation.remove === 'function'
    ) {
      relation.remove.call(self, parentRecord, record)
    }

    self.splice(index, 1)

    return self
  }
204164
@Override
	public int hash(Record object) {
		int i = 0;
		try {
			int code = 0;
			for (; i < this.keyFields.length; i++) {
				code ^= object.getField(this.keyFields[i], this.transientKeyHolders[i]).hashCode();
				code *= HASH_SALT[i & 0x1F]; // salt code with (i % HASH_SALT.length)-th salt component
			}
			return code;
		}
		catch (NullPointerException npex) {
			throw new NullKeyFieldException(this.keyFields[i]);
		}
		catch (IndexOutOfBoundsException iobex) {
			throw new KeyFieldOutOfBoundsException(this.keyFields[i]);
		}
	}
1218533
function (blockDef, blockIdx) {
                if (blockDef.start.test(line)) {
                    blocksStack.push([blockIdx, lineNum, line.trim()]);
                }

                if (blockDef.end.test(line) && typeof last(blocksStack) !== "undefined") {
                    if (last(blocksStack)[0] === blockIdx) {
                        blocksStack.pop();
                    } else {
                        generateMessage({
                            start: last(blocksStack)[2],
                            pattern: line.trim(),
                            lineNum: last(blocksStack)[1],
                            endLineNum: lineNum,
                            caseNum: 3
                        });
                    }
                } else if (startCount - endCount > 1) {
                    generateMessage({
                        start: last(blocksStack)[2],
                        pattern: line.trim(),
                        lineNum: last(blocksStack)[1],
                        endLineNum: lineNum,
                        caseNum: 3
                    });
                }
            }
1016604
def _add_block_number_to_hash_lookup(db: BaseDB, header: BlockHeader) -> None:
        
        block_number_to_hash_key = SchemaV1.make_block_number_to_hash_lookup_key(
            header.block_number
        )
        db.set(
            block_number_to_hash_key,
            rlp.encode(header.hash, sedes=rlp.sedes.binary),
        )
643990
function BlockProof(hash, root, nonce1, nonce2, time, nonce) {
  this.hash = hash;
  this.root = root;
  this.nonce1 = nonce1;
  this.nonce2 = nonce2;
  this.time = time;
  this.nonce = nonce;
}
1259145
function (hash, data) {
    this.length++;
    this.elements[hash] = {
      hash: hash, // Helps identifying 
      freq: 0,
      data: data
    };
  }
358764
def block(*, name = None, metric = call_default, count = 1):
    
    t = time.time()
    try:
        yield
    finally:
        metric(name, count, time.time() - t)