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);
|
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();
|
return tx.txid();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -298,13 +298,13 @@ FullNode.prototype.sendTX = async function sendTX(tx) {
|
|||||||
try {
|
try {
|
||||||
missing = await this.mempool.addTX(tx);
|
missing = await this.mempool.addTX(tx);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.type === 'VerifyError' && err.score === 0) {
|
// if (err.type === 'VerifyError' && err.score === 0) {
|
||||||
this.error(err);
|
// this.error(err);
|
||||||
this.logger.warning('Verification failed for tx: %s.', tx.txid());
|
// this.logger.warning('Verification failed for tx: %s.', tx.txid());
|
||||||
this.logger.warning('Attempting to broadcast anyway...');
|
// this.logger.warning('Attempting to broadcast anyway...');
|
||||||
this.broadcast(tx);
|
// this.broadcast(tx);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user