@leofcoin/chain 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain.js +1 -1
- package/dist/module/chain.js +1 -1
- package/package.json +1 -1
- package/src/chain.js +1 -1
package/dist/chain.js
CHANGED
|
@@ -634,8 +634,8 @@ async #lastBlockHandler() {
|
|
|
634
634
|
async resolveBlock(hash) {
|
|
635
635
|
if (!hash) throw new Error(`expected hash, got: ${hash}`)
|
|
636
636
|
let block = await peernet.get(hash, 'block');
|
|
637
|
-
if (!await peernet.has(hash, 'block')) await peernet.put(hash, block, 'block');
|
|
638
637
|
block = await new BlockMessage(block);
|
|
638
|
+
if (!await peernet.has(hash, 'block')) await peernet.put(hash, block.encoded, 'block');
|
|
639
639
|
const size = block.encoded.length || block.encoded.byteLength;
|
|
640
640
|
block = {...block.decoded, hash};
|
|
641
641
|
this.#blocks[block.index] = block;
|
package/dist/module/chain.js
CHANGED
|
@@ -626,8 +626,8 @@ async #lastBlockHandler() {
|
|
|
626
626
|
async resolveBlock(hash) {
|
|
627
627
|
if (!hash) throw new Error(`expected hash, got: ${hash}`)
|
|
628
628
|
let block = await peernet.get(hash, 'block');
|
|
629
|
-
if (!await peernet.has(hash, 'block')) await peernet.put(hash, block, 'block');
|
|
630
629
|
block = await new BlockMessage(block);
|
|
630
|
+
if (!await peernet.has(hash, 'block')) await peernet.put(hash, block.encoded, 'block');
|
|
631
631
|
const size = block.encoded.length || block.encoded.byteLength;
|
|
632
632
|
block = {...block.decoded, hash};
|
|
633
633
|
this.#blocks[block.index] = block;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/chain",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\"><img alt=\"Creative Commons Licence\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-nc/4.0/88x31.png\" /></a><br />This work is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\">Creative Commons Attribution-NonCommercial 4.0 International License</a>.",
|
|
5
5
|
"main": "./dist/node.js",
|
|
6
6
|
"module": "./dist/chain.esm",
|
package/src/chain.js
CHANGED
|
@@ -242,8 +242,8 @@ async #lastBlockHandler() {
|
|
|
242
242
|
async resolveBlock(hash) {
|
|
243
243
|
if (!hash) throw new Error(`expected hash, got: ${hash}`)
|
|
244
244
|
let block = await peernet.get(hash, 'block')
|
|
245
|
-
if (!await peernet.has(hash, 'block')) await peernet.put(hash, block, 'block')
|
|
246
245
|
block = await new BlockMessage(block)
|
|
246
|
+
if (!await peernet.has(hash, 'block')) await peernet.put(hash, block.encoded, 'block')
|
|
247
247
|
const size = block.encoded.length || block.encoded.byteLength
|
|
248
248
|
block = {...block.decoded, hash}
|
|
249
249
|
this.#blocks[block.index] = block
|