This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved 'receivePayment()' into ThunderContext
- Loading branch information
Showing
3 changed files
with
37 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
thunder-core/src/main/java/network/thunder/core/helper/PaymentRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package network.thunder.core.helper; | ||
|
||
import network.thunder.core.communication.layer.high.payments.PaymentSecret; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
public class PaymentRequest { | ||
public long amount; | ||
public PaymentSecret paymentSecret; | ||
public byte[] pubkey; | ||
|
||
public byte[] getPayload () { | ||
|
||
ByteBuffer buffer = ByteBuffer.allocate(33 + 8 + 20); | ||
|
||
buffer.putLong(amount); | ||
buffer.put(paymentSecret.hash); | ||
buffer.put(pubkey); | ||
|
||
return buffer.array(); | ||
} | ||
} |