add #getTx
This commit is contained in:
parent
01ef9e8702
commit
f7e60084f2
|
@ -433,6 +433,23 @@ CopayServer.prototype.createTx = function(opts, cb) {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves a tx from storage.
|
||||
* @param {Object} opts
|
||||
* @param {string} opts.walletId - The wallet id.
|
||||
* @param {string} opts.id - The tx id.
|
||||
* @returns {Object} txProposal
|
||||
*/
|
||||
CopayServer.prototype.getTx = function(opts, cb) {
|
||||
var self = this;
|
||||
|
||||
self.storage.fetchTx(opts.walletId, opts.id, function(err, txp) {
|
||||
if (err) return cb(err);
|
||||
if (!txp) return cb(new ClientError('Transaction proposal not found'));
|
||||
return cb(null, txp);
|
||||
});
|
||||
};
|
||||
|
||||
CopayServer.prototype._broadcastTx = function(rawTx, cb) {
|
||||
// TODO: this should attempt to broadcast _all_ accepted and not-yet broadcasted (status=='accepted') txps?
|
||||
cb = cb || function() {};
|
||||
|
|
Loading…
Reference in New Issue