Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 8 additions & 1 deletion coinjoin/coinjoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ func verifyOutput(c Caller, outpoint *wire.OutPoint, value int64) error {
ctx, cancel := context.WithTimeout(context.Background(), rpcTimeout)
defer cancel()
var res struct {
Value float64 `json:"value"`
Value float64 `json:"value"`
Confirmations int64 `json:"confirmations"`
}
err := c.Call(ctx, "gettxout", &res, outpoint.Hash.String(), outpoint.Index, outpoint.Tree)
if err != nil {
Expand All @@ -323,6 +324,12 @@ func verifyOutput(c Caller, outpoint *wire.OutPoint, value int64) error {
nil,
}
}
if res.Confirmations <= 0 {
return &blameError{
fmt.Sprintf("output %v has not been confirmed", outpoint),
nil,
}
}
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion integration/honest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var inputValueJSON []byte
func TestMain(m *testing.M) {
flag.Parse()
inputValue = int64(*mFlag) + 1
inputValueJSON = []byte(fmt.Sprintf(`{"value":%v}`, inputValue))
inputValueJSON = []byte(fmt.Sprintf(`{"value":%v,"confirmations":1}`, inputValue))
os.Exit(m.Run())
}

Expand Down