UNPKG

bitcoin-cli-ts

Version:

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

21 lines (20 loc) 1.07 kB
// Auto synced from github actions. Don't change this file import { __rest } from "tslib"; import request from '../../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. * */ export function getBlockFromPeer(params) { var bitcoind = params.bitcoind, methodParams = __rest(params, ["bitcoind"]); return request({ method: 'getblockfrompeer', params: methodParams }, bitcoind); }