paych: Set nil cid in ChannelMessage if not creating channel

This commit is contained in:
Łukasz Magiera 2019-09-16 20:06:14 +02:00
parent 133ab265d4
commit 12c777a3c7

View File

@ -65,10 +65,14 @@ func (a *PaychAPI) PaychNewPayment(ctx context.Context, from, to address.Address
if err != nil {
return nil, err
}
var pchCid *cid.Cid
if ch.ChannelMessage != cid.Undef {
pchCid = &ch.ChannelMessage
}
return &api.PaymentInfo{
Channel: ch.Channel,
ChannelMessage: &ch.ChannelMessage,
ChannelMessage: pchCid,
Voucher: sv,
}, nil
}