src/main/java/org/iota/ict/ixi/GraphModule.java
public List<Transaction> completeBundle(Transaction head) {

        if(!head.isBundleHead) {
            return new ArrayList<>();
        }

        List<Transaction> bundle = new ArrayList<>();
        bundle.add(head);

        String currentHead = head.trunkHash();

        while(true) {

            Transaction next = ixi.findTransactionByHash(currentHead);

            if(next == null)
                return new ArrayList<>();

            bundle.add(next);

            if(next.isBundleTail)
                return bundle;

            currentHead = next.trunkHash();

        }

    }
/**
     * Tries to complete a bundle by a given transaction.
     * @return the completed bundle.
     */
Tries to complete a bundle by a given transaction.
@return the completed bundle.
Tries to complete a bundle by a given transaction . @return the completed bundle .
public List<Transaction> completeBundle(Transaction head) {
        if(!head.isBundleHead) {
            return new ArrayList<>();
        }
        List<Transaction> bundle = new ArrayList<>();
        bundle.add(head);
        String currentHead = head.trunkHash();
        while(true) {
            Transaction next = ixi.findTransactionByHash(currentHead);
            if(next == null)
                return new ArrayList<>();
            bundle.add(next);
            if(next.isBundleTail)
                return bundle;
            currentHead = next.trunkHash();
        }
    }
public List < Transaction > completeBundle ( Transaction head ) { if ( ! head . isBundleHead ) { return new ArrayList < > ( ) ; } List < Transaction > bundle = new ArrayList < > ( ) ; bundle . add ( head ) ; String currentHead = head . trunkHash ( ) ; while ( true ) { Transaction next = ixi . findTransactionByHash ( currentHead ) ; if ( next == null ) return new ArrayList < > ( ) ; bundle . add ( next ) ; if ( next . isBundleTail ) return bundle ; currentHead = next . trunkHash ( ) ; } }
Tries to complete a bundle by a given transaction.
Tries to complete a bundle by a given transaction .