Skip to content

Commit cbe59cf

Browse files
Add Tx Data Content
1 parent c12818c commit cbe59cf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chives-light-node",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Chivesweave Light Node",
55
"main": "main.js",
66
"type": "module",

src/syncing.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2702,6 +2702,11 @@
27022702
ItemJson.data = {}
27032703
ItemJson.data.size = Item.data_size
27042704
ItemJson.data.type = contentTypeToFileType(Item.content_type)
2705+
ItemJson.data.content = ""
2706+
if(ItemJson.data.type == "" && ItemJson.data.size > 0 && Item.id && Item.id.length == 43) {
2707+
const FileContentBuffer = readFile("files/" + Item.id.substring(0, 2).toLowerCase(), Item.id, "getTxData", null);
2708+
ItemJson.data.content = FileContentBuffer.toString('utf-8');
2709+
}
27052710
ItemJson.fee = {}
27062711
ItemJson.fee.winston = Item.reward
27072712
ItemJson.fee.xwe = String(Item.reward/1000000000000)

0 commit comments

Comments
 (0)