Skip to content

Commit

Permalink
Merge pull request #3 from XYOracleNetwork/develop
Browse files Browse the repository at this point in the history
check number of options
  • Loading branch information
carterharrison committed Feb 13, 2019
2 parents c307a4a + 18d2be7 commit 128b34d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sdk-core-swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'sdk-core-swift'
s.version = '0.1.2-beta.2'
s.version = '0.1.2-beta.3'
s.summary = 'Core Library for XYO Network in Swift.'

# This description is used to generate tags and improve search results.
Expand Down
17 changes: 9 additions & 8 deletions sdk-core-swift/node/XyoOriginChainCreator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,17 @@ open class XyoOriginChainCreator {
private func getBoundWitneesesOptionsForFlag (flag : [UInt8]) -> [XyoBoundWitnessOption] {
var retunOptions = [XyoBoundWitnessOption]()

for option in boundWitnessOptions.values {
for i in 0...(min(option.getFlag().count, flag.count) - 1) {
let otherCatalogueSection = option.getFlag()[option.getFlag().count - i - 1]
let thisCatalogueSection = flag[flag.count - i - 1]

if (otherCatalogueSection & thisCatalogueSection != 0) {
retunOptions.append(option)
for option in boundWitnessOptions.values {
if (min(option.getFlag().count, flag.count) != 0) {
for i in 0...(min(option.getFlag().count, flag.count) - 1) {
let otherCatalogueSection = option.getFlag()[option.getFlag().count - i - 1]
let thisCatalogueSection = flag[flag.count - i - 1]

if (otherCatalogueSection & thisCatalogueSection != 0) {
retunOptions.append(option)
}
}
}

}

return retunOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public class XyoStrageProviderOriginBlockRepository: XyoOriginBlockRepository {
let currentIndex = try getBlockIndex().getNewIterator()

while try currentIndex.hasNext() {



let hashInList = try currentIndex.next()

if (hashInList.getBuffer().toByteArray() != hashToRemove) {
Expand Down

0 comments on commit 128b34d

Please sign in to comment.