Skip to content

Commit 411205a

Browse files
authored
index timestamp regardless of filter (#201)
1 parent 45c77de commit 411205a

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

wallet/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async fn main() -> anyhow::Result<()> {
7676
matches![v,
7777
OuterVerifier::Sr25519Signature(Sr25519Signature { owner_pubkey })
7878
if crate::keystore::has_key(&keystore, owner_pubkey)
79-
] || matches![v, OuterVerifier::UpForGrabs(UpForGrabs)] // used for timestamp
79+
]
8080
};
8181

8282
if !sled::Db::was_recovered(&db) {

wallet/src/sync.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,13 @@ async fn apply_transaction<F: Fn(&OuterVerifier) -> bool, C: ConstraintChecker>(
280280
let tx = Transaction::<OuterVerifier, C>::decode(&mut &encoded_extrinsic[..])?;
281281

282282
// Insert all new outputs
283-
for (index, output) in tx
284-
.outputs
285-
.iter()
286-
.filter(|o| filter(&o.verifier))
287-
.enumerate()
288-
{
283+
for (index, output) in tx.outputs.iter().enumerate() {
289284
// For now the wallet only supports simple coins and timestamp
290285
match output.payload.type_id {
291286
Coin::<0>::TYPE_ID => {
292-
crate::money::apply_transaction(db, tx_hash, index as u32, output)?;
287+
if filter(&output.verifier) {
288+
crate::money::apply_transaction(db, tx_hash, index as u32, output)?;
289+
}
293290
}
294291
Timestamp::TYPE_ID => {
295292
crate::timestamp::apply_transaction(db, output)?;

0 commit comments

Comments
 (0)