diff --git a/rust-libs/duniter-dbs-write-ops/src/gva/tx.rs b/rust-libs/duniter-dbs-write-ops/src/gva/tx.rs index d4ef23ae9e394c81f62b405d3bce89e3168a2bc7..94ab275e14ac38fa868201cd86c0004adc580a74 100644 --- a/rust-libs/duniter-dbs-write-ops/src/gva/tx.rs +++ b/rust-libs/duniter-dbs-write-ops/src/gva/tx.rs @@ -43,7 +43,7 @@ pub(crate) fn apply_tx<B: Backend>( // Insert on col `txs_by_issuer` for pubkey in tx.issuers() { let mut hashs = txs_by_issuer.get(&PubKeyKeyV2(pubkey))?.unwrap_or_default(); - hashs.insert(tx_hash); + hashs.push(tx_hash); txs_by_issuer.upsert(PubKeyKeyV2(pubkey), hashs); } // Insert on col `txs_by_recipient` @@ -51,7 +51,7 @@ pub(crate) fn apply_tx<B: Backend>( let mut hashs = txs_by_recipient .get(&PubKeyKeyV2(pubkey))? .unwrap_or_default(); - hashs.insert(tx_hash); + hashs.push(tx_hash); txs_by_recipient.upsert(PubKeyKeyV2(pubkey), hashs); } @@ -243,7 +243,7 @@ fn remove_tx<B: Backend>( // Remove tx hash in col `txs_by_issuer` for pubkey in tx_db.tx.issuers() { let mut hashs_ = txs_by_issuer.get(&PubKeyKeyV2(pubkey))?.unwrap_or_default(); - hashs_.remove(&tx_hash); + hashs_.pop(); txs_by_issuer.upsert(PubKeyKeyV2(pubkey), hashs_) } // Remove tx hash in col `txs_by_recipient` @@ -251,7 +251,7 @@ fn remove_tx<B: Backend>( let mut hashs_ = txs_by_recipient .get(&PubKeyKeyV2(pubkey))? .unwrap_or_default(); - hashs_.remove(&tx_hash); + hashs_.pop(); txs_by_recipient.upsert(PubKeyKeyV2(pubkey), hashs_) } // Remove tx itself diff --git a/rust-libs/duniter-dbs/src/gva_v1.rs b/rust-libs/duniter-dbs/src/gva_v1.rs index e1a0e85f2d2db870cf9990d601bb1650ede3b357..66c14eb069708a784f6aad39183516d44f66ad8e 100644 --- a/rust-libs/duniter-dbs/src/gva_v1.rs +++ b/rust-libs/duniter-dbs/src/gva_v1.rs @@ -19,8 +19,8 @@ db_schema!( GvaV1, [ ["txs", Txs, HashKeyV2, TxDbV2], - ["txs_by_issuer", TxsByIssuer, PubKeyKeyV2, BTreeSet<Hash>], - ["txs_by_recipient", TxsByRecipient, PubKeyKeyV2, BTreeSet<Hash>], + ["txs_by_issuer", TxsByIssuer, PubKeyKeyV2, Vec<Hash>], + ["txs_by_recipient", TxsByRecipient, PubKeyKeyV2, Vec<Hash>], [ "scripts_by_pubkey", ScriptsByPubkey,