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:
Alexander Blair
2017-10-13 12:01:19 -07:00
parent 5d31708abf
commit 667bc5a029
7 changed files with 81 additions and 51 deletions
+6 -4
View File
@@ -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
View File
@@ -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
View File
@@ -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);
});
};