-
Notifications
You must be signed in to change notification settings - Fork 370
added bundle validity rules #1786
added bundle validity rules #1786
Conversation
f2c04ca
to
ce190ae
Compare
public static Validity validateBundleTransactionsApproval(List<TransactionViewModel> bundleTxs){ | ||
Hash headTrunkTransactionHash = bundleTxs.get(bundleTxs.size() - 1).getTrunkTransactionHash(); | ||
for(int i = 0; i < bundleTxs.size() - 1; i++){ | ||
if(!bundleTxs.get(i).getBranchTransactionHash().equals(headTrunkTransactionHash)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually I don't like all those concatenated gets becuase they mask nulls
but I think here no nulls would appear anyhows
9114a60
to
e19b91f
Compare
e19b91f
to
47f5497
Compare
47f5497
to
75938f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
* added bundle validity rules * commented on test and added invalid bundle tests * Fix: lower error severity for faulty neighbor to warning (iotaledger#1710) Co-authored-by: Dyrell Chapman <dyrell.chapman@iota.org>
* added bundle validity rules * commented on test and added invalid bundle tests * Fix: lower error severity for faulty neighbor to warning (iotaledger#1710) Co-authored-by: Dyrell Chapman <dyrell.chapman@iota.org>
Manual tests: rule 1: It only approves tail transactions
rule 2: All transactions within the bundle approve via their branch the trunk transaction of the head transaction Db and source here: https://github.com/acha-bill/iri_bundle_validity |
Description
Adds 2 new rules for bundle validity. A bundle is valid if:
Fixes #1746
Type of change
How Has This Been Tested?
Checklist: