Skip to content

Commit

Permalink
Merge pull request #65 from LN-Zap/fix/correct-bitcoind-rpc
Browse files Browse the repository at this point in the history
Fix casing issue for bitcoind getMemPoolInfo RPC
  • Loading branch information
nordbjorn authored Jan 30, 2025
2 parents 47291ca + 07b9dd1 commit 131dd5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ interface BestBlockHashResponse {
result: string;
}

interface MempoolInfoResponse {
result: MempoolInfo;
interface MemPoolInfoResponse {
result: MemPoolInfo;
}

interface MempoolInfo {
interface MemPoolInfo {
mempoolminfee: number;
}

Expand Down
8 changes: 4 additions & 4 deletions src/providers/bitcoind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ export class BitcoindProvider implements Provider {
* @returns A promise that resolves to the fetched min fee rate.
*/
async getMinRelayFeeRate(): Promise<number> {
const getMempoolInfo = promisify(
this.rpc.getMempoolInfo.bind(this.rpc),
const getMemPoolInfo = promisify(
this.rpc.getMemPoolInfo.bind(this.rpc),
);

const response = await getMempoolInfo();
log.trace({ message: "getMempoolInfo", response: response.result });
const response = await getMemPoolInfo();
log.trace({ message: "getMemPoolInfo", response: response.result });

const feeRate = response.result?.mempoolminfee;
if (!feeRate) {
Expand Down
4 changes: 2 additions & 2 deletions test/bitcoind.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ mockRpcClient.estimateSmartFee = (
cb: (error: any, result: EstimateSmartFeeBatchResponse) => void,
) => cb(null, { result: { feerate: 1000 } });

mockRpcClient.getMempoolInfo = (
cb: (error: any, result: MempoolInfoResponse) => void,
mockRpcClient.getMemPoolInfo = (
cb: (error: any, result: MemPoolInfoResponse) => void,
) => cb(null, { result: { mempoolminfee: 0.00001234 } });

const provider = new BitcoindProvider(
Expand Down

0 comments on commit 131dd5e

Please sign in to comment.