Update chain prevHash cache.
This commit is contained in:
parent
9890a4f0da
commit
4f281dcefe
@ -220,6 +220,9 @@ Node.prototype._syncBitcoind = function() {
|
||||
// Populate height
|
||||
block.__height = self.chain.tip.__height + 1;
|
||||
|
||||
// Update chain hashes
|
||||
self.chain.cache.hashes[block.hash] = block.prevHash;
|
||||
|
||||
// Create indexes
|
||||
self.db._onChainAddBlock(block, function(err) {
|
||||
if (err) {
|
||||
|
||||
@ -177,7 +177,10 @@ describe('Bitcoind Node', function() {
|
||||
hash: block.prevHash
|
||||
},
|
||||
saveMetadata: sinon.stub(),
|
||||
emit: sinon.stub()
|
||||
emit: sinon.stub(),
|
||||
cache: {
|
||||
hashes: {}
|
||||
}
|
||||
};
|
||||
node.db = {
|
||||
_onChainAddBlock: function(block, callback) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user