UNPKG

bitcoin-cli-ts

Version:

Auto-generated Bitcoin client library for bitcoind JSON-RPC API

25 lines (24 loc) 1.28 kB
"use strict"; // Auto synced from github actions. Don't change this file Object.defineProperty(exports, "__esModule", { value: true }); exports.getBlockFromPeer = void 0; var tslib_1 = require("tslib"); var rpc_request_1 = tslib_1.__importDefault(require("../../rpc-request")); /** * getblockfrompeer "blockhash" peer_id * * Attempt to fetch block from a given peer. * We must have the header for this block, e.g. using submitheader. * The block will not have any undo data which can limit the usage of the block data in a context where the undo data is needed. * Subsequent calls for the same block may cause the response from the previous peer to be ignored. * Peers generally ignore requests for a stale block that they never fully verified, or one that is more than a month old. * When a peer does not respond with a block, we will disconnect. * Note: The block could be re-pruned as soon as it is received. * Returns an empty JSON object if the request was successfully scheduled. * */ function getBlockFromPeer(params) { var bitcoind = params.bitcoind, methodParams = tslib_1.__rest(params, ["bitcoind"]); return (0, rpc_request_1.default)({ method: 'getblockfrompeer', params: methodParams }, bitcoind); } exports.getBlockFromPeer = getBlockFromPeer;