test: let daemon create a new pre-image in the multi-hop test

If the RPreimage field is left off when adding a new invoice, the
daemon will create a new random pre-image itself for the requested
payment.
This commit is contained in:
Olaoluwa Osuntokun 2017-01-07 21:20:02 -08:00
parent ec0c7c5989
commit d3612ac00a
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -753,11 +753,9 @@ func testMultiHopPayments(net *networkHarness, t *harnessTest) {
const paymentAmt = 1000 const paymentAmt = 1000
rHashes := make([][]byte, numPayments) rHashes := make([][]byte, numPayments)
for i := 0; i < numPayments; i++ { for i := 0; i < numPayments; i++ {
preimage := bytes.Repeat([]byte{byte(i)}, 32)
invoice := &lnrpc.Invoice{ invoice := &lnrpc.Invoice{
Memo: "testing", Memo: "testing",
RPreimage: preimage, Value: paymentAmt,
Value: paymentAmt,
} }
resp, err := net.Bob.AddInvoice(ctxb, invoice) resp, err := net.Bob.AddInvoice(ctxb, invoice)
if err != nil { if err != nil {
@ -1596,6 +1594,7 @@ func testHtlcErrorPropagation(net *networkHarness, t *harnessTest) {
if err := carol.shutdown(); err != nil { if err := carol.shutdown(); err != nil {
t.Fatalf("unable to shutdown carol: %v", err) t.Fatalf("unable to shutdown carol: %v", err)
} }
time.Sleep(time.Second * 2)
alicePayStream, err = net.Alice.SendPayment(ctxb) alicePayStream, err = net.Alice.SendPayment(ctxb)
if err != nil { if err != nil {
t.Fatalf("unable to create payment stream: %v", err) t.Fatalf("unable to create payment stream: %v", err)