dashpay/platform

DAPI: Calls to `getTransaction` only valid if wallet is loaded

kxcd opened this issue · 0 comments

kxcd commented

// This is only for in-wallet transaction
const getTransaction = (txid) => new Promise((resolve, reject) => {
client.gettransaction(txid, (err, r) => {
if (err) {
reject(new DashCoreRpcError(err.message, null, err.code));
} else {
resolve(r.result);
}
});
});
const getTransactionFirstInputAddress = (txId) => new Promise((resolve, reject) => {
client.gettransaction(txId, (err, r) => {
if (err) {
reject(new DashCoreRpcError(err.message, null, err.code));
} else {
resolve(r.details.address);
}
});
});

Where is is this getting called? A masternode does not have an attached wallet, so calling this on an MN will return the empty set and an error. IMO these two methods should be removed.