rpc: minor.
This commit is contained in:
parent
0873f7abe8
commit
9c8d4d185f
@ -2516,14 +2516,13 @@ RPC.prototype.resendwallettransactions = function resendwallettransactions(args,
|
|||||||
if (args.help || args.length !== 0)
|
if (args.help || args.length !== 0)
|
||||||
return callback(new RPCError('resendwallettransactions'));
|
return callback(new RPCError('resendwallettransactions'));
|
||||||
|
|
||||||
this.wallet.getUnconfirmed(function(err, txs) {
|
this.wallet.resend(function(err, txs) {
|
||||||
if (err)
|
if (err)
|
||||||
return callback(err);
|
return callback(err);
|
||||||
|
|
||||||
for (i = 0; i < txs.length; i++) {
|
for (i = 0; i < txs.length; i++) {
|
||||||
tx = txs[i];
|
tx = txs[i];
|
||||||
hashes.push(tx.rhash);
|
hashes.push(tx.rhash);
|
||||||
self.pool.broadcast(tx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(null, hashes);
|
callback(null, hashes);
|
||||||
@ -2555,7 +2554,7 @@ RPC.prototype.backupwallet = function backupwallet(args, callback) {
|
|||||||
|
|
||||||
RPC.prototype.dumpprivkey = function dumpprivkey(args, callback) {
|
RPC.prototype.dumpprivkey = function dumpprivkey(args, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var hash, key;
|
var hash;
|
||||||
|
|
||||||
if (args.help || args.length !== 1)
|
if (args.help || args.length !== 1)
|
||||||
return callback(new RPCError('dumpprivkey "bitcoinaddress"'));
|
return callback(new RPCError('dumpprivkey "bitcoinaddress"'));
|
||||||
@ -2572,9 +2571,7 @@ RPC.prototype.dumpprivkey = function dumpprivkey(args, callback) {
|
|||||||
if (!ring)
|
if (!ring)
|
||||||
return callback(new RPCError('Key not found.'));
|
return callback(new RPCError('Key not found.'));
|
||||||
|
|
||||||
key = self.wallet.master.key;
|
if (!self.wallet.master.key)
|
||||||
|
|
||||||
if (!key)
|
|
||||||
return callback(new RPCError('Wallet is locked.'));
|
return callback(new RPCError('Wallet is locked.'));
|
||||||
|
|
||||||
callback(null, ring.toSecret());
|
callback(null, ring.toSecret());
|
||||||
@ -2583,7 +2580,7 @@ RPC.prototype.dumpprivkey = function dumpprivkey(args, callback) {
|
|||||||
|
|
||||||
RPC.prototype.dumpwallet = function dumpwallet(args, callback) {
|
RPC.prototype.dumpwallet = function dumpwallet(args, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var file, time, key, address, fmt, str, out;
|
var file, time, address, fmt, str, out;
|
||||||
|
|
||||||
if (args.help || args.length !== 1)
|
if (args.help || args.length !== 1)
|
||||||
return callback(new RPCError('dumpwallet "filename"'));
|
return callback(new RPCError('dumpwallet "filename"'));
|
||||||
@ -2615,9 +2612,7 @@ RPC.prototype.dumpwallet = function dumpwallet(args, callback) {
|
|||||||
if (!ring)
|
if (!ring)
|
||||||
return next();
|
return next();
|
||||||
|
|
||||||
key = self.wallet.master.key;
|
if (!self.wallet.master.key)
|
||||||
|
|
||||||
if (!key)
|
|
||||||
return callback(new RPCError('Wallet is locked.'));
|
return callback(new RPCError('Wallet is locked.'));
|
||||||
|
|
||||||
address = ring.getAddress('base58');
|
address = ring.getAddress('base58');
|
||||||
@ -3891,7 +3886,7 @@ RPC.prototype.settxfee = function settxfee(args, callback) {
|
|||||||
|
|
||||||
RPC.prototype.signmessage = function signmessage(args, callback) {
|
RPC.prototype.signmessage = function signmessage(args, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var address, msg, key, sig;
|
var address, msg, sig;
|
||||||
|
|
||||||
if (args.help || args.length !== 2)
|
if (args.help || args.length !== 2)
|
||||||
return callback(new RPCError('signmessage "bitcoinaddress" "message"'));
|
return callback(new RPCError('signmessage "bitcoinaddress" "message"'));
|
||||||
@ -3911,9 +3906,7 @@ RPC.prototype.signmessage = function signmessage(args, callback) {
|
|||||||
if (!ring)
|
if (!ring)
|
||||||
return callback(new RPCError('Address not found.'));
|
return callback(new RPCError('Address not found.'));
|
||||||
|
|
||||||
key = self.wallet.master.key;
|
if (!self.wallet.master.key)
|
||||||
|
|
||||||
if (!key)
|
|
||||||
return callback(new RPCError('Wallet is locked.'));
|
return callback(new RPCError('Wallet is locked.'));
|
||||||
|
|
||||||
msg = new Buffer(RPC.magic + msg, 'utf8');
|
msg = new Buffer(RPC.magic + msg, 'utf8');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user