Skip to content
Snippets Groups Projects
Commit 59f5e6ef authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] Protocol: always fill in `conditions` field for SINDEX

parent 98c940ee
Branches
Tags
No related merge requests found
......@@ -233,8 +233,8 @@ const indexer = module.exports = {
unlock: txObj.unlocks[k],
amount: input.amount,
base: input.base,
consumed: true,
conditions: null,
consumed: true,
txObj: txObj
});
k++;
......@@ -253,8 +253,8 @@ const indexer = module.exports = {
locktime: obj.locktime,
amount: output.amount,
base: output.base,
consumed: false,
conditions: output.conditions,
consumed: false,
txObj: obj
});
}
......@@ -713,6 +713,7 @@ const indexer = module.exports = {
amount: ENTRY.amount,
base: ENTRY.base
});
ENTRY.conditions = reduce(reducable).conditions; // We valuate the input conditions, so we can map these records to a same account
ENTRY.available = reduce(reducable).consumed === false;
}));
......
......@@ -2027,11 +2027,13 @@ Else:
EndIf
####### BR_G46 - ENTRY.available
####### BR_G46 - ENTRY.available and ENTRY.conditions
For each `LOCAL_SINDEX[op='UPDATE'] as ENTRY`:
ENTRY.available = REDUCE(GLOBAL_SINDEX[identifier=ENTRY.identifier,pos=ENTRY.pos,amount=ENTRY.amount,base=ENTRY.base]).consumed == false
INPUT = REDUCE(GLOBAL_SINDEX[identifier=ENTRY.identifier,pos=ENTRY.pos,amount=ENTRY.amount,base=ENTRY.base])
ENTRY.conditions = INPUT.conditions
ENTRY.available = INPUT.consumed == false
####### BR_G47 - ENTRY.isLocked
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment