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.

42 lines
923 B

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