coinview: fixes.
This commit is contained in:
parent
a1601b8f3a
commit
5602001348
@ -457,8 +457,8 @@ CoinView.prototype.getSize = function getSize(tx) {
|
||||
|
||||
size += tx.inputs.length;
|
||||
|
||||
for (let input of tx.inputs) {
|
||||
let coin = this.getEntry(input);
|
||||
for (let {prevout} of tx.inputs) {
|
||||
let coin = this.getEntry(prevout);
|
||||
|
||||
if (!coin)
|
||||
continue;
|
||||
@ -477,8 +477,8 @@ CoinView.prototype.getSize = function getSize(tx) {
|
||||
*/
|
||||
|
||||
CoinView.prototype.toWriter = function toWriter(bw, tx) {
|
||||
for (let input of tx.inputs) {
|
||||
let coin = this.getEntry(input);
|
||||
for (let {prevout} of tx.inputs) {
|
||||
let coin = this.getEntry(prevout);
|
||||
|
||||
if (!coin) {
|
||||
bw.writeU8(0);
|
||||
|
||||
@ -1695,7 +1695,7 @@ Mempool.prototype.findMissing = function findMissing(tx, view) {
|
||||
if (view.hasEntry(prevout))
|
||||
continue;
|
||||
|
||||
missing.push(input.prevout.hash);
|
||||
missing.push(prevout.hash);
|
||||
}
|
||||
|
||||
if (missing.length === 0)
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const assert = require('assert');
|
||||
const Bloom = require('../lib/utils/bloom');
|
||||
const Block = require('../lib/primitives/block');
|
||||
@ -14,6 +13,7 @@ const Output = require('../lib/primitives/output');
|
||||
const encoding = require('../lib/utils/encoding');
|
||||
const bip152 = require('../lib/net/bip152');
|
||||
const BufferReader = require('../lib/utils/reader');
|
||||
const fs = require('../lib/utils/fs');
|
||||
|
||||
const block300025 = require('./data/block300025.json');
|
||||
const cmpct2block = fs.readFileSync(`${__dirname}/data/cmpct2.bin`);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user