rpc: abandontransaction.
This commit is contained in:
parent
f9daa3b947
commit
780601b3b7
@ -2957,7 +2957,27 @@ RPC.prototype.gettransaction = function gettransaction(args, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
RPC.prototype.abandontransaction = function abandontransaction(args, callback) {
|
RPC.prototype.abandontransaction = function abandontransaction(args, callback) {
|
||||||
callback(new Error('Not implemented.'));
|
var hash;
|
||||||
|
|
||||||
|
if (args.help || args.length !== 1)
|
||||||
|
return callback(new RPCError('abandontransaction "txid"'));
|
||||||
|
|
||||||
|
hash = args[0];
|
||||||
|
|
||||||
|
if (!utils.isHex(hash) || hash.length !== 64)
|
||||||
|
return callback(new RPCError('Invalid parameter.'));
|
||||||
|
|
||||||
|
hash = utils.revHex(hash);
|
||||||
|
|
||||||
|
this.walletdb.tx.remove(hash, function(err, result) {
|
||||||
|
if (err)
|
||||||
|
return callback(err);
|
||||||
|
|
||||||
|
if (!result)
|
||||||
|
return callback(new RPCError('Transaction not in wallet.'));
|
||||||
|
|
||||||
|
callback(null, null);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
RPC.prototype.getunconfirmedbalance = function getunconfirmedbalance(args, callback) {
|
RPC.prototype.getunconfirmedbalance = function getunconfirmedbalance(args, callback) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user