Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions crates/protorune/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub fn validate_rune_etch(tx: &Transaction, commitment: Vec<u8>, height: u64) ->
.get_value();

// add 1 to follow the ordinals spec: https://github.com/ordinals/ord/blob/master/src/index/updater/rune_updater.rs#L454
let confirmations = height - h + 1;
let confirmations = height.checked_sub(h).unwrap() + 1;
if confirmations >= 6 {
return Ok(true);
}
Expand Down Expand Up @@ -618,8 +618,9 @@ impl Protorune {
.select(&tx_id.as_byte_array().to_vec())
.set_value(txindex as u32);
for (_index, input) in transaction.input.iter().enumerate() {
tables::OUTPOINT_SPENDABLE_BY.select(&consensus_encode(&input.previous_output)?).nullify();

tables::OUTPOINT_SPENDABLE_BY
.select(&consensus_encode(&input.previous_output)?)
.nullify();
}
for (index, output) in transaction.output.iter().enumerate() {
let outpoint = OutPoint {
Expand Down
1 change: 1 addition & 0 deletions crates/protorune/src/protostone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use std::fmt::Write;

static mut PROTOCOLS: Option<HashSet<u128>> = None;

// this will reset every time its called
#[allow(static_mut_refs)]
pub fn initialized_protocol_index() -> Result<()> {
unsafe { PROTOCOLS = Some(HashSet::new()) }
Expand Down