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