Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable starting multiple tss processes with the same peer subset #331

Merged
merged 17 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix same age inputs being ordered differently
  • Loading branch information
mpetrun5 committed Jul 16, 2024
commit 27edd380b11d7f8d6e48b442fb0f149f0d45322e
6 changes: 5 additions & 1 deletion chains/btc/mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ func (a *MempoolAPI) Utxos(address string) ([]Utxo, error) {
return nil, err
}
sort.Slice(utxos, func(i int, j int) bool {
return utxos[i].Status.BlockTime < utxos[j].Status.BlockTime
if utxos[i].Status.BlockTime == utxos[j].Status.BlockTime {
return utxos[i].TxID < utxos[j].TxID
} else {
return utxos[i].Status.BlockTime < utxos[j].Status.BlockTime
}
})

return utxos, nil
Expand Down
11 changes: 11 additions & 0 deletions chains/btc/mempool/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ func (s *MempoolTestSuite) Test_Utxo_SuccessfulFetch() {
BlockTime: 1715083122,
},
},
{
TxID: "28154e2008912d27978225c096c22ffe2ea65e1d55bf440ee41c21f9489c7fe2",
Vout: 0,
Value: 11197,
Status: mempool.Status{
Confirmed: true,
BlockHeight: 2812826,
BlockHash: "000000000000001a01d4058773384f2c23aed5a7e5ede252f99e290fa58324a3",
BlockTime: 1715083122,
},
},
{
TxID: "28154e2008912d27978225c096c22ffe2ea65e1d55bf440ee41c21f9489c7fe9",
Vout: 0,
Expand Down
1 change: 1 addition & 0 deletions chains/btc/mempool/test-data/successful-utxo.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
{"txid":"28154e2008912d27978225c096c22ffe2ea65e1d55bf440ee41c21f9489c7fe9","vout":0,"status":{"confirmed":true,"block_height":2812827,"block_hash":"000000000000001a01d4058773384f2c23aed5a7e5ede252f99e290fa58324a5","block_time":1715083123},"value":11198},
{"txid":"28154e2008912d27978225c096c22ffe2ea65e1d55bf440ee41c21f9489c7fe2","vout":0,"status":{"confirmed":true,"block_height":2812826,"block_hash":"000000000000001a01d4058773384f2c23aed5a7e5ede252f99e290fa58324a3","block_time":1715083122},"value":11197},
{"txid":"28154e2008912d27978225c096c22ffe2ea65e1d55bf440ee41c21f9489c7fe1","vout":0,"status":{"confirmed":true,"block_height":2812826,"block_hash":"000000000000001a01d4058773384f2c23aed5a7e5ede252f99e290fa58324a3","block_time":1715083122},"value":11197}
]
Loading