Skip to content

Commit

Permalink
when fetching next_block, make sure it's from main chain
Browse files Browse the repository at this point in the history
to avoid a side-block considering its own txs doublespends
  • Loading branch information
mhanne committed Sep 13, 2012
1 parent ae27844 commit 0295bb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bitcoin/storage/sequel.rb
Expand Up @@ -214,7 +214,7 @@ def get_block_by_depth(depth)

# get block by given +prev_hash+
def get_block_by_prev_hash(prev_hash)
wrap_block(@db[:blk][:prev_hash => htb(prev_hash).to_sequel_blob])
wrap_block(@db[:blk][:prev_hash => htb(prev_hash).to_sequel_blob, :chain => MAIN])
end

# get block by given +tx_hash+
Expand Down

0 comments on commit 0295bb0

Please sign in to comment.