Skip to content

Commit 222634c

Browse files
authored
Merge pull request #63 from buffrr/fix-outbid
Fix outbid sending a bid after open
2 parents 928aa3b + e5bf6d1 commit 222634c

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

node/src/wallets.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,10 @@ impl RpcWallet {
579579
continue;
580580
}
581581

582-
let foreign_input = match event.foreign_input {
583-
None => continue,
584-
Some(outpoint) => outpoint
585-
};
586-
if foreign_input != space.outpoint() {
587-
res.outbid.push(space);
582+
if event.foreign_input.is_some_and(|input| input == space.outpoint()) {
583+
continue;
588584
}
585+
res.outbid.push(space);
589586
}
590587
}
591588

node/tests/integration_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ async fn it_should_allow_outbidding(rig: &TestRig) -> anyhow::Result<()> {
105105
alice_spaces_updated.winning.len(),
106106
"alice must have one less space"
107107
);
108-
// assert_eq!(
109-
// alices_spaces.outbid.len() + 1,
110-
// alice_spaces_updated.outbid.len(),
111-
// "alice must have one less space"
112-
// );
108+
assert_eq!(
109+
alices_spaces.outbid.len() + 1,
110+
alice_spaces_updated.outbid.len(),
111+
"alice must have one less space"
112+
);
113113
assert_eq!(
114114
bobs_spaces.winning.len() + 1,
115115
bob_spaces_updated.winning.len(),

0 commit comments

Comments
 (0)