Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Added send transaction logging for re-send
Browse files Browse the repository at this point in the history
  • Loading branch information
karelbilek authored and losh11 committed May 11, 2017
1 parent 75efe16 commit e8eef5f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/services/bitcoind.js
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,18 @@ Bitcoin.prototype.sendTransaction = function(tx, options, callback) {
if (err) {
return callback(self._wrapRPCError(err));
}
callback(null, response.result);

if (typeof self.options.sendTxLog === 'string') {
fs.appendFile(self.options.sendTxLog, tx + '\n', function(error) {
if (error) {
// error on logging tx -> write to error log, but still return success to user
console.error(error);
}
callback(null, response.result);
});
} else {
callback(null, response.result);
}
});

};
Expand Down

0 comments on commit e8eef5f

Please sign in to comment.