mirror of
https://github.com/Nathanwoodburn/FireWallet.git
synced 2024-11-10 09:18:15 +11:00
hsd-ledger: Removed using files to store batch info
This commit is contained in:
parent
2bfca908a9
commit
3f6c2bdded
14
hsd-ledger
14
hsd-ledger
@ -136,20 +136,14 @@ async function sendRaw(wclient, nclient, config, ledger, args) { // Create a fun
|
|||||||
const network = Network.get(config.str('network')); // Get the network
|
const network = Network.get(config.str('network')); // Get the network
|
||||||
const id = config.str('wallet-id'); // Get the wallet id
|
const id = config.str('wallet-id'); // Get the wallet id
|
||||||
const acct = config.str('account-name'); // Get the account name
|
const acct = config.str('account-name'); // Get the account name
|
||||||
const batch = args[0]; // Get the batch file location
|
// Log the arguments to the console (for debugging)
|
||||||
const nameslocation = args[1]; // Get the names file location
|
|
||||||
|
|
||||||
|
const batch = JSON.parse(args[0]); // Get the batch
|
||||||
|
const names = JSON.parse(args[1]); // Get the names
|
||||||
await wclient.execute('selectwallet', [id]); // Select the wallet
|
await wclient.execute('selectwallet', [id]); // Select the wallet
|
||||||
|
|
||||||
|
|
||||||
const fs = require('fs'); // Import fs (used to read files)
|
|
||||||
try {
|
try {
|
||||||
const data = fs.readFileSync(batch, 'utf8'); // Read the batch file
|
const mtx = MTX.fromJSON(batch.result); // Create a new MTX from the JSON
|
||||||
const json = JSON.parse(data); // Parse the batch file as JSON
|
|
||||||
const mtx = MTX.fromJSON(json.result); // Create a new MTX from the JSON
|
|
||||||
|
|
||||||
const namefile = fs.readFileSync(nameslocation, 'utf8'); // Read the names file
|
|
||||||
const names = namefile.split(','); // Split the names file into an array
|
|
||||||
const hashes = {}; // Create an empty object to store the hashes
|
const hashes = {}; // Create an empty object to store the hashes
|
||||||
for (const name of names) { // Loop through the names
|
for (const name of names) { // Loop through the names
|
||||||
const hash = hashName(name); // Hash the name
|
const hash = hashName(name); // Hash the name
|
||||||
|
Loading…
Reference in New Issue
Block a user