Skip to content

Commit e345540

Browse files
committed
Merge branch 'master' of github.com:ordinals/ord into tweak-outputs-return
2 parents fcdfe42 + 83d87d4 commit e345540

File tree

6 files changed

+27
-14
lines changed

6 files changed

+27
-14
lines changed

deploy/setup

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ case $CHAIN in
5353
CSP_ORIGIN=signet.ordinals.com
5454
ufw allow 38333
5555
;;
56-
testnet3)
56+
test)
5757
COOKIE_FILE_DIR=/var/lib/bitcoind/testnet3
5858
CSP_ORIGIN=testnet.ordinals.com
5959
ufw allow 18333

justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ deploy-signet branch='master' remote='ordinals/ord': \
5050
(deploy branch remote 'signet' 'signet.ordinals.net')
5151

5252
deploy-testnet branch='master' remote='ordinals/ord': \
53-
(deploy branch remote 'testnet3' 'testnet.ordinals.net')
53+
(deploy branch remote 'test' 'testnet.ordinals.net')
5454

5555
deploy-testnet4 branch='master' remote='ordinals/ord': \
5656
(deploy branch remote 'testnet4' 'testnet4.ordinals.net')

src/index.rs

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pub(crate) enum Statistic {
9191
Runes = 13,
9292
SatRanges = 14,
9393
UnboundInscriptions = 16,
94+
LastSavepointHeight = 17,
9495
}
9596

9697
impl Statistic {

src/index/reorg.rs

+19-11
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,21 @@ impl Reorg {
8383
return Ok(());
8484
}
8585

86-
if (height < SAVEPOINT_INTERVAL || height % SAVEPOINT_INTERVAL == 0)
87-
&& u32::try_from(
88-
index
89-
.settings
90-
.bitcoin_rpc_client(None)?
91-
.get_blockchain_info()?
92-
.headers,
93-
)
94-
.unwrap()
95-
.saturating_sub(height)
96-
<= CHAIN_TIP_DISTANCE
86+
let height = u64::from(height);
87+
88+
let last_savepoint_height = index
89+
.begin_read()?
90+
.0
91+
.open_table(STATISTIC_TO_COUNT)?
92+
.get(&Statistic::LastSavepointHeight.key())?
93+
.map(|last_savepoint_height| last_savepoint_height.value())
94+
.unwrap_or(0);
95+
96+
let blocks = index.client.get_blockchain_info()?.headers;
97+
98+
if (height < SAVEPOINT_INTERVAL.into()
99+
|| height.saturating_sub(last_savepoint_height) >= SAVEPOINT_INTERVAL.into())
100+
&& blocks.saturating_sub(height) <= CHAIN_TIP_DISTANCE.into()
97101
{
98102
let wtx = index.begin_write()?;
99103

@@ -111,6 +115,10 @@ impl Reorg {
111115
log::debug!("creating savepoint at height {}", height);
112116
wtx.persistent_savepoint()?;
113117

118+
wtx
119+
.open_table(STATISTIC_TO_COUNT)?
120+
.insert(&Statistic::LastSavepointHeight.key(), &height)?;
121+
114122
Index::increment_statistic(&wtx, Statistic::Commits, 1)?;
115123
wtx.commit()?;
116124
}

static/preview-video.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
document.getElementsByTagName('video')[0].addEventListener('click', (event) => {
2+
event.target.controls = true;
3+
});

templates/preview-video.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
<head>
44
<meta charset=utf-8>
55
<link rel=stylesheet href=/static/preview-video.css>
6+
<script src=/static/preview-video.js type=module defer></script>
67
</head>
78
<body>
8-
<video controls loop muted autoplay>
9+
<video loop muted autoplay>
910
<source src=/content/{{self.inscription_id}}>
1011
</video>
1112
</body>

0 commit comments

Comments
 (0)