Return Transaction Errors from RPC
This commit is contained in:
parent
2d5bfb45e2
commit
dea7e6042f
@ -1788,7 +1788,12 @@ RPC.prototype.sendRawTransaction = async function sendRawTransaction(args, help)
|
||||
|
||||
const tx = TX.fromRaw(data);
|
||||
|
||||
this.node.relay(tx);
|
||||
var response
|
||||
try {
|
||||
response = await this.node.sendTX(tx);
|
||||
} catch(e) {
|
||||
throw e
|
||||
}
|
||||
|
||||
return tx.txid();
|
||||
};
|
||||
|
||||
@ -298,13 +298,13 @@ FullNode.prototype.sendTX = async function sendTX(tx) {
|
||||
try {
|
||||
missing = await this.mempool.addTX(tx);
|
||||
} catch (err) {
|
||||
if (err.type === 'VerifyError' && err.score === 0) {
|
||||
this.error(err);
|
||||
this.logger.warning('Verification failed for tx: %s.', tx.txid());
|
||||
this.logger.warning('Attempting to broadcast anyway...');
|
||||
this.broadcast(tx);
|
||||
return;
|
||||
}
|
||||
// if (err.type === 'VerifyError' && err.score === 0) {
|
||||
// this.error(err);
|
||||
// this.logger.warning('Verification failed for tx: %s.', tx.txid());
|
||||
// this.logger.warning('Attempting to broadcast anyway...');
|
||||
// this.broadcast(tx);
|
||||
// return;
|
||||
// }
|
||||
throw err;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user