Skip to content

Commit

Permalink
Update utxoracle.js
Browse files Browse the repository at this point in the history
  • Loading branch information
22388o authored Oct 2, 2023
1 parent 7b351fb commit 73be4bc
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/dlc/utxoracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,9 @@ const rpcClient = bitcoin.Client(rpcConfig);
const latestTimeInSeconds = block.time;
const latestTimeDatetime = new Date(latestTimeInSeconds * 1000).toUTCString();
const latestTimeUTC = latestTimeDatetime.slice(0, -4);
const latestPriceData = await.priceData.getblockCount();

const yesterdayInSeconds = latestTimeInSeconds - 24 * 60 * 60;
const latestPriceDate = new Date(yesterdayInSeconds * 1000).toISOString().slice(0, 10);

console.log(`Connected to local node at block #: ${blockCount}`);
console.log(`Latest available price date is: ${latestPriceDate}`);
console.log("Earliest available price date is: 2020-07-26 (full node)");

// Your date input logic here

// Rest of the code (Parts 4 to 9) would go here

} catch (error) {
console.error("Error connecting to your node. Trouble shooting steps:\n");
console.error("1) Make sure Bitcoin Core is running and reachable.");
console.error("2) Make sure you have set up your Bitcoin Core RPC configuration.");
console.error("3) Explore the Bitcoin Core RPC options in your JavaScript code.");
console.error("\nThe error was:", error);
process.exit(1);
}
})();

0 comments on commit 73be4bc

Please sign in to comment.