You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
923 B

#!/usr/bin/env node
var _ = require('lodash');
var program = require('commander');
var Client = require('../lib/client');
var common = require('./common');
program
.version('0.0.1')
.option('-c,--config [file]', 'Wallet config filename')
.option('-v,--verbose', 'be verbose')
.usage('[options] <txpid> [reason]')
.parse(process.argv);
var args = program.args;
if (!args[0])
program.help();
var txpid = args[0];
var reason = args[1] || '';
var cli = new Client({
filename: program.config
});
cli.getTxProposals({}, function(err, txps) {
common.die(err);
if (program.verbose)
console.log('* Raw Server Response:\n', txps); //TODO
var txp = common.findOneTxProposal(txps, txpid);
cli.rejectTxProposal(txp, reason, function(err, tx) {
common.die(err);
if (program.verbose)
console.log('* Raw Server Response:\n', tx); //TODO
console.log('Transaction rejected.');
});
});