mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-12-01 11:43:58 +01:00
Update with fixes to finish getting AEON working and to block things from blocking when I don't expect them to.
AEON has a block on the way it does chain saving, which can lock up many portions of the blockManager daemon. This is now patched in blockmanager.
This commit is contained in:
+6
-4
@@ -31,9 +31,10 @@ function Coin(data){
|
||||
this.getBlockHeaderByID = function(blockId, callback){
|
||||
global.support.rpcDaemon('getblockheaderbyheight', {"height": blockId}, function (body) {
|
||||
if (body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -41,10 +42,10 @@ function Coin(data){
|
||||
this.getBlockHeaderByHash = function(blockHash, callback){
|
||||
global.support.rpcDaemon('getblockheaderbyhash', {"hash": blockHash}, function (body) {
|
||||
if (typeof(body) !== 'undefined' && body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
return callback(false);
|
||||
return callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -52,9 +53,10 @@ function Coin(data){
|
||||
this.getLastBlockHeader = function(callback){
|
||||
global.support.rpcDaemon('getlastblockheader', [], function (body) {
|
||||
if (typeof(body) !== 'undefined' && body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
return callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
+6
-4
@@ -31,9 +31,10 @@ function Coin(data){
|
||||
this.getBlockHeaderByID = function(blockId, callback){
|
||||
global.support.rpcDaemon('getblockheaderbyheight', {"height": blockId}, function (body) {
|
||||
if (body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
return callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -41,10 +42,10 @@ function Coin(data){
|
||||
this.getBlockHeaderByHash = function(blockHash, callback){
|
||||
global.support.rpcDaemon('getblockheaderbyhash', {"hash": blockHash}, function (body) {
|
||||
if (typeof(body) !== 'undefined' && body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
return callback(false);
|
||||
return callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -52,9 +53,10 @@ function Coin(data){
|
||||
this.getLastBlockHeader = function(callback){
|
||||
global.support.rpcDaemon('getlastblockheader', [], function (body) {
|
||||
if (typeof(body) !== 'undefined' && body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
return callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
+7
-5
@@ -45,9 +45,10 @@ function Coin(data){
|
||||
this.getBlockHeaderByID = function(blockId, callback){
|
||||
global.support.rpcDaemon('getblockheaderbyheight', {"height": blockId}, function (body) {
|
||||
if (body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
return callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -55,10 +56,10 @@ function Coin(data){
|
||||
this.getBlockHeaderByHash = function(blockHash, callback){
|
||||
global.support.rpcDaemon('getblockheaderbyhash', {"hash": blockHash}, function (body) {
|
||||
if (typeof(body) !== 'undefined' && body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
return callback(false);
|
||||
return callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -66,9 +67,10 @@ function Coin(data){
|
||||
this.getLastBlockHeader = function(callback){
|
||||
global.support.rpcDaemon('getlastblockheader', [], function (body) {
|
||||
if (typeof(body) !== 'undefined' && body.hasOwnProperty('result')){
|
||||
return callback(body.result.block_header);
|
||||
return callback(null, body.result.block_header);
|
||||
} else {
|
||||
console.error(JSON.stringify(body));
|
||||
return callback(true, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -78,7 +80,7 @@ function Coin(data){
|
||||
reserve_size: 17,
|
||||
wallet_address: walletAddress
|
||||
}, function(body){
|
||||
return callback(body);
|
||||
return callback(err, body);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user