Skip to content

Commit 9d3d3b4

Browse files
author
diogorac
committed
fix on index of inputs/outputs
1 parent b787891 commit 9d3d3b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/transaction.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ char* bigchain_build_json_inputs(BIGCHAIN_INPUT *inputs, uint8_t num_inputs, cha
4343
for(uint8_t i = 0; i < num_inputs; i++) {
4444
p = json_objOpen(p, NULL);
4545
if(inputs[i].fulfillment[0] != '\0') {
46-
p = json_str(p, "fulfillment", inputs[0].fulfillment);
46+
p = json_str(p, "fulfillment", inputs[i].fulfillment);
4747
} else {
4848
p = json_null(p, "fulfillment");
4949
}
5050

5151
if(inputs[i].fulfills[0] != '\0') {
52-
p = json_str(p, "fulfills", inputs[0].fulfills);
52+
p = json_str(p, "fulfills", inputs[i].fulfills);
5353
} else {
5454
p = json_null(p, "fulfills");
5555
}
5656

5757
p = json_arrOpen(p, "owners_before");
58-
for (uint8_t j = 0; j < inputs[0].num_owners; j++) {
59-
p = json_str(p, NULL, inputs[0].owners_before[j]);
58+
for (uint8_t j = 0; j < inputs[i].num_owners; j++) {
59+
p = json_str(p, NULL, inputs[i].owners_before[j]);
6060
}
6161
p = json_arrClose(p);
6262
p = json_objClose(p);

0 commit comments

Comments
 (0)