mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
itest: use hex encoded hash in error message
This commit is contained in:
parent
09f2307d14
commit
241e21a0d1
1 changed files with 6 additions and 4 deletions
|
@ -11019,11 +11019,12 @@ func assertActiveHtlcs(nodes []*lntest.HarnessNode, payHashes ...[]byte) error {
|
||||||
// Record all payment hashes active for this channel.
|
// Record all payment hashes active for this channel.
|
||||||
htlcHashes := make(map[string]struct{})
|
htlcHashes := make(map[string]struct{})
|
||||||
for _, htlc := range channel.PendingHtlcs {
|
for _, htlc := range channel.PendingHtlcs {
|
||||||
_, ok := htlcHashes[string(htlc.HashLock)]
|
h := hex.EncodeToString(htlc.HashLock)
|
||||||
|
_, ok := htlcHashes[h]
|
||||||
if ok {
|
if ok {
|
||||||
return fmt.Errorf("duplicate HashLock")
|
return fmt.Errorf("duplicate HashLock")
|
||||||
}
|
}
|
||||||
htlcHashes[string(htlc.HashLock)] = struct{}{}
|
htlcHashes[h] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Channel should have exactly the payHashes active.
|
// Channel should have exactly the payHashes active.
|
||||||
|
@ -11035,12 +11036,13 @@ func assertActiveHtlcs(nodes []*lntest.HarnessNode, payHashes ...[]byte) error {
|
||||||
|
|
||||||
// Make sure all the payHashes are active.
|
// Make sure all the payHashes are active.
|
||||||
for _, payHash := range payHashes {
|
for _, payHash := range payHashes {
|
||||||
if _, ok := htlcHashes[string(payHash)]; ok {
|
h := hex.EncodeToString(payHash)
|
||||||
|
if _, ok := htlcHashes[h]; ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return fmt.Errorf("node %x didn't have the "+
|
return fmt.Errorf("node %x didn't have the "+
|
||||||
"payHash %v active", node.PubKey[:],
|
"payHash %v active", node.PubKey[:],
|
||||||
payHash)
|
h)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue