Skip to content

Commit

Permalink
fix handleRPCRefreshContract and handleRPCRenewContract
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Dec 18, 2024
1 parent e303773 commit 9f94d7c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rhp/v4/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ func (s *Server) handleRPCRefreshContract(stream net.Conn) error {

// update renter inputs to reflect our chain state
if basis != req.Basis {
hostInputs := renewalTxn.SiacoinInputs[len(renewalTxn.SiacoinInputs)-len(req.RenterInputs):]
renewalTxn.SiacoinInputs = renewalTxn.SiacoinInputs[:len(renewalTxn.SiacoinInputs)-len(req.RenterInputs)]
hostInputs := renewalTxn.SiacoinInputs[len(req.RenterInputs):]
renewalTxn.SiacoinInputs = renewalTxn.SiacoinInputs[:len(req.RenterInputs)]
updated, err := s.chain.UpdateV2TransactionSet([]types.V2Transaction{renewalTxn}, req.Basis, basis)
if err != nil {
return errorBadRequest("failed to update renter inputs from %q to %q: %v", req.Basis, basis, err)
Expand Down Expand Up @@ -891,8 +891,8 @@ func (s *Server) handleRPCRenewContract(stream net.Conn) error {

// update renter inputs to reflect our chain state
if basis != req.Basis {
hostInputs := renewalTxn.SiacoinInputs[len(renewalTxn.SiacoinInputs)-len(req.RenterInputs):]
renewalTxn.SiacoinInputs = renewalTxn.SiacoinInputs[:len(renewalTxn.SiacoinInputs)-len(req.RenterInputs)]
hostInputs := renewalTxn.SiacoinInputs[len(req.RenterInputs):]
renewalTxn.SiacoinInputs = renewalTxn.SiacoinInputs[:len(req.RenterInputs)]
updated, err := s.chain.UpdateV2TransactionSet([]types.V2Transaction{renewalTxn}, req.Basis, basis)
if err != nil {
return errorBadRequest("failed to update renter inputs from %q to %q: %v", req.Basis, basis, err)
Expand Down

0 comments on commit 9f94d7c

Please sign in to comment.