Skip to content

Commit

Permalink
index timestamp regardless of filter
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff committed Apr 16, 2024
1 parent c03a33d commit 4b9fb06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion wallet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn main() -> anyhow::Result<()> {
matches![v,
OuterVerifier::Sr25519Signature(Sr25519Signature { owner_pubkey })
if crate::keystore::has_key(&keystore, owner_pubkey)
] || matches![v, OuterVerifier::UpForGrabs(UpForGrabs)] // used for timestamp
]
};

if !sled::Db::was_recovered(&db) {
Expand Down
11 changes: 4 additions & 7 deletions wallet/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,13 @@ async fn apply_transaction<F: Fn(&OuterVerifier) -> bool, C: ConstraintChecker>(
let tx = Transaction::<OuterVerifier, C>::decode(&mut &encoded_extrinsic[..])?;

// Insert all new outputs
for (index, output) in tx
.outputs
.iter()
.filter(|o| filter(&o.verifier))
.enumerate()
{
for (index, output) in tx.outputs.iter().enumerate() {
// For now the wallet only supports simple coins and timestamp
match output.payload.type_id {
Coin::<0>::TYPE_ID => {
crate::money::apply_transaction(db, tx_hash, index as u32, output)?;
if filter(&output.verifier) {
crate::money::apply_transaction(db, tx_hash, index as u32, output)?;
}
}
Timestamp::TYPE_ID => {
crate::timestamp::apply_transaction(db, output)?;
Expand Down

0 comments on commit 4b9fb06

Please sign in to comment.