UNPKG

@vafanassieff/bitcoin-cli-ts

Version:

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

20 lines 1.05 kB
// Auto synced from github actions. Don't change this file import request from '../../rpc-request.js'; /** * 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) { const { bitcoind, ...methodParams } = params; return request({ method: 'getblockfrompeer', params: methodParams }, bitcoind); } //# sourceMappingURL=get-block-from-peer.js.map