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.

30 lines
750 B

10 years ago
#!/usr/bin/env node
var _ = require('lodash');
var program = require('commander');
var Client = require('../lib/client');
var utils = require('./cli-utils');
program = utils.configureCommander(program);
10 years ago
program
10 years ago
.usage('[options] <txpid> [reason]')
10 years ago
.parse(process.argv);
var args = program.args;
var txpid = args[0] || '';
10 years ago
var reason = args[1] || '';
var client = utils.getClient(program);
10 years ago
client.getTxProposals({}, function(err, txps) {
utils.die(err);
10 years ago
var txp = utils.findOneTxProposal(txps, txpid);
client.rejectTxProposal(txp, reason, function(err, tx) {
utils.die(err);
if (tx.status == 'rejected')
10 years ago
console.log('Transaction finally rejected.');
else
console.log('Transaction rejected by you.');
10 years ago
});
});