Notes on payment amount

This commit is contained in:
Joseph Poon
2015-12-31 00:41:55 -08:00
committed by Olaoluwa Osuntokun
parent 266c121510
commit b3f812e5da
4 changed files with 9 additions and 13 deletions

View File

@@ -20,6 +20,9 @@ type FundingRequest struct {
//which is a payment to the responder
//(This can be used to fund the Reserve)
//If the responder disagrees, then the funding request fails
//THIS VALUE GOES INTO THE RESPONDER'S FUNDING AMOUNT
//total requester input value = RequesterFundingAmount + PaymentAmount + "Total Change"
//RequesterFundingAmount = "Available Balance" - RequesterReserveAmount
PaymentAmount btcutil.Amount
//Minimum number of confirmations to validate transaction
@@ -169,10 +172,6 @@ func (c *FundingRequest) Validate() error {
if c.PaymentAmount < 0 {
return fmt.Errorf("This wallet requieres payment to be greater than zero.")
}
//The payment must be below our own contribution (less reserve kept for ourselves
if c.PaymentAmount > c.RequesterFundingAmount-c.RequesterReserveAmount {
return fmt.Errorf("Payment too large")
}
//Make sure there's not more than 127 inputs
if len(c.Inputs) > 127 {