bitcoind: fix tx event to include tx buffer

This commit is contained in:
Braydon Fuller 2016-04-05 14:50:49 -04:00
parent 60333bcb0e
commit b473b65207

View File

@ -125,9 +125,9 @@ Bitcoin.prototype._loadConfiguration = function() {
);
$.checkState(
this.configuration.zmqpubhashtx,
'"zmqpubhashtx" option is required to get event updates from bitcoind. ' +
'Please add "zmqpubhashtx=tcp://127.0.0.1:<port>" to your configuration and restart'
this.configuration.zmqpubrawtx,
'"zmqpubrawtx" option is required to get event updates from bitcoind. ' +
'Please add "zmqpubrawtx=tcp://127.0.0.1:<port>" to your configuration and restart'
);
$.checkState(
@ -157,12 +157,12 @@ Bitcoin.prototype._registerEventHandlers = function() {
var self = this;
this.zmqSubSocket.subscribe('hashblock');
this.zmqSubSocket.subscribe('hashtx');
this.zmqSubSocket.subscribe('rawtx');
this.zmqSubSocket.on('message', function(topic, message) {
var topicString = topic.toString('utf8');
if (topicString === 'hashtx') {
self.emit('tx', message.toString('hex'));
if (topicString === 'rawtx') {
self.emit('tx', message);
} else if (topicString === 'hashblock') {
self._resetCaches();
self.tiphash = message.toString('hex');
@ -291,7 +291,7 @@ Bitcoin.prototype.start = function(callback) {
});
self.zmqSubSocket.monitor(500, 0);
self.zmqSubSocket.connect(self.configuration.zmqpubhashtx);
self.zmqSubSocket.connect(self.configuration.zmqpubrawtx);
if (self._reindex) {
var interval = setInterval(function() {