Merge pull request #12 from OstlerDev/master

Fix Segwit Signature check by adding floData length
This commit is contained in:
Sky Young 2019-10-28 13:55:29 -06:00 committed by GitHub
commit c38e2af1de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

2
.gitignore vendored
View File

@ -8,4 +8,4 @@ coverage/
yarn.lock
webpack.*.js
.DS_Store
tmp
tmp*

View File

@ -719,7 +719,16 @@ class TX {
}
}
const size = 156 + prev.getVarSize();
// Calculate the extra floData size to add to the Buffer when initializing
let extraFloDataSize = 0
if (this.version >= 2 && includeFloData){
let bufferLength = this.floData.length;
extraFloDataSize += encoding.sizeVarint(bufferLength);
extraFloDataSize += bufferLength
}
const size = 156 + prev.getVarSize() + extraFloDataSize;
const bw = bio.pool(size);
bw.writeU32(this.version);

View File

@ -1,6 +1,6 @@
{
"name": "fcoin",
"version": "1.1.1",
"version": "1.1.2",
"description": "FLO bike-shed",
"license": "MIT",
"repository": "git://github.com/oipwg/fcoin.git",
@ -79,7 +79,9 @@
"test-browser": "NODE_BACKEND=js bmocha --reporter spec test/*.js",
"test-file": "bmocha --reporter spec",
"test-file-browser": "NODE_BACKEND=js bmocha --reporter spec",
"test-ci": "nyc -a -n 'lib/**/*.js' --reporter=lcov --reporter=text npm run test"
"test-ci": "nyc -a -n 'lib/**/*.js' --reporter=lcov --reporter=text npm run test",
"dev": "./bin/fcoin --prefix=\"${PWD}/tmp\" --network=testnet",
"livenet": "./bin/fcoin --prefix=\"${PWD}/tmp\""
},
"browser": {
"./lib/hd/nfkd": "./lib/hd/nfkd-compat.js",