mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-11-10 08:13:56 +01:00
@@ -0,0 +1,19 @@
|
|||||||
|
"use strict";
|
||||||
|
let mysql = require("promise-mysql");
|
||||||
|
let fs = require("fs");
|
||||||
|
let argv = require('minimist')(process.argv.slice(2));
|
||||||
|
let config = fs.readFileSync("../config.json");
|
||||||
|
let coinConfig = fs.readFileSync("../coinConfig.json");
|
||||||
|
let protobuf = require('protocol-buffers');
|
||||||
|
|
||||||
|
global.support = require("../lib/support.js")();
|
||||||
|
global.config = JSON.parse(config);
|
||||||
|
global.mysql = mysql.createPool(global.config.mysql);
|
||||||
|
global.protos = protobuf(fs.readFileSync('../lib/data.proto'));
|
||||||
|
let comms;
|
||||||
|
comms = require('../lib/local_comms');
|
||||||
|
global.database = new comms();
|
||||||
|
global.database.initEnv();
|
||||||
|
global.database.lockBlock(argv.blockID);
|
||||||
|
console.log("Block "+argv.blockID+" re-locked! Exiting!");
|
||||||
|
process.exit();
|
||||||
+1
-1
@@ -286,7 +286,7 @@ function calculatePPLNSPayments(blockHeader) {
|
|||||||
}
|
}
|
||||||
cursor.close();
|
cursor.close();
|
||||||
txn.abort();
|
txn.abort();
|
||||||
callback(null, totalPaid);
|
setImmediate(callback, null, totalPaid);
|
||||||
}, function (totalPayment) {
|
}, function (totalPayment) {
|
||||||
blockCheckHeight = blockCheckHeight - 1;
|
blockCheckHeight = blockCheckHeight - 1;
|
||||||
debug("Decrementing the block chain check height to:" + blockCheckHeight);
|
debug("Decrementing the block chain check height to:" + blockCheckHeight);
|
||||||
|
|||||||
@@ -324,6 +324,17 @@ function Database(){
|
|||||||
txn.commit();
|
txn.commit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.lockBlock = function(blockId){
|
||||||
|
let txn = this.env.beginTxn();
|
||||||
|
let blockProto = txn.getBinary(this.blockDB, blockId);
|
||||||
|
if (blockProto !== null){
|
||||||
|
let blockData = global.protos.Block.decode(blockProto);
|
||||||
|
blockData['unlocked'] = false;
|
||||||
|
txn.putBinary(this.blockDB, blockId, global.protos.Block.encode(blockData));
|
||||||
|
}
|
||||||
|
txn.commit();
|
||||||
|
};
|
||||||
|
|
||||||
this.getCache = function(cacheKey){
|
this.getCache = function(cacheKey){
|
||||||
debug("Getting Key: "+cacheKey);
|
debug("Getting Key: "+cacheKey);
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user