{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/comments/342024001","pull_request_review_id":311033544,"id":342024001,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0MjAyNDAwMQ==","diff_hunk":"@@ -402,68 +411,43 @@ sealed abstract class BitcoinTxBuilder extends TxBuilder {\n         remaining: Seq[BitcoinUTXOSpendingInfo],\n         currentLockTime: UInt32): Try[UInt32] = remaining match {\n       case Nil => Success(currentLockTime)\n-      case BitcoinUTXOSpendingInfo(outpoint,\n-                                   output,\n-                                   signers,\n-                                   redeemScriptOpt,\n-                                   scriptWitOpt,\n-                                   hashType) :: t =>\n-        output.scriptPubKey match {\n-          case cltv: CLTVScriptPubKey =>\n-            val lockTime =\n-              if (cltv.locktime.toLong > UInt32.max.toLong || cltv.locktime.toLong < 0) {\n-                TxBuilderError.IncompatibleLockTimes\n-              } else Success(UInt32(cltv.locktime.toLong))\n-            val result = lockTime.flatMap { l: UInt32 =>\n-              if (currentLockTime < l) {\n-                val lockTimeThreshold = tc.locktimeThreshold\n-                if (currentLockTime < lockTimeThreshold && l >= lockTimeThreshold) {\n-                  //means that we spend two different locktime types, one of the outputs spends a\n-                  //OP_CLTV script by block height, the other spends one by time stamp\n-                  TxBuilderError.IncompatibleLockTimes\n-                } else Success(l)\n-              } else Success(currentLockTime)\n-            }\n-            result\n-          case _: P2SHScriptPubKey | _: P2WSHWitnessSPKV0 =>\n-            if (redeemScriptOpt.isDefined) {\n-              //recursively call with redeem script as output script\n-              val o = TransactionOutput(output.value, redeemScriptOpt.get)\n-              val i = BitcoinUTXOSpendingInfo(outpoint,\n-                                              o,\n-                                              signers,\n-                                              None,\n-                                              scriptWitOpt,\n-                                              hashType)\n-              loop(i +: t, currentLockTime)\n-            } else if (scriptWitOpt.isDefined) {\n-              scriptWitOpt.get match {\n-                case EmptyScriptWitness    => loop(t, currentLockTime)\n-                case _: P2WPKHWitnessV0    => loop(t, currentLockTime)\n-                case p2wsh: P2WSHWitnessV0 =>\n-                  //recursively call with the witness redeem script as the script\n-                  val o = TransactionOutput(output.value, p2wsh.redeemScript)\n-                  val i = BitcoinUTXOSpendingInfo(outpoint,\n-                                                  o,\n-                                                  signers,\n-                                                  redeemScriptOpt,\n-                                                  None,\n-                                                  hashType)\n-                  loop(i +: t, currentLockTime)\n-              }\n-            } else {\n-              loop(t, currentLockTime)\n+      case spendingInfo :: newRemaining =>","path":"core/src/main/scala/org/bitcoins/core/wallet/builder/TxBuilder.scala","position":90,"original_position":90,"commit_id":"208c5cbcf1dc8ae6d96a8182abfc7cc160ac50be","original_commit_id":"208c5cbcf1dc8ae6d96a8182abfc7cc160ac50be","user":{"login":"Christewart","id":3514957,"node_id":"MDQ6VXNlcjM1MTQ5NTc=","avatar_url":"https://avatars3.githubusercontent.com/u/3514957?v=4","gravatar_id":"","url":"https://api.github.com/users/Christewart","html_url":"https://github.com/Christewart","followers_url":"https://api.github.com/users/Christewart/followers","following_url":"https://api.github.com/users/Christewart/following{/other_user}","gists_url":"https://api.github.com/users/Christewart/gists{/gist_id}","starred_url":"https://api.github.com/users/Christewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Christewart/subscriptions","organizations_url":"https://api.github.com/users/Christewart/orgs","repos_url":"https://api.github.com/users/Christewart/repos","events_url":"https://api.github.com/users/Christewart/events{/privacy}","received_events_url":"https://api.github.com/users/Christewart/received_events","type":"User","site_admin":false},"body":"just a note: we should probably use `+:` for pattern matching on collections as I believe `::` can throw a exception for certain types of collections. \r\n\r\nI know `::` is used elsewhere in this file -- it is unsafe and depends on the scala runtime \"deciding\" on what collections to use. We should be moving to use `+:` ","created_at":"2019-11-04T12:25:17Z","updated_at":"2019-11-04T12:35:43Z","html_url":"https://github.com/bitcoin-s/bitcoin-s/pull/827#discussion_r342024001","pull_request_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/827","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/comments/342024001"},"html":{"href":"https://github.com/bitcoin-s/bitcoin-s/pull/827#discussion_r342024001"},"pull_request":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/827"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/827","id":331749326,"node_id":"MDExOlB1bGxSZXF1ZXN0MzMxNzQ5MzI2","html_url":"https://github.com/bitcoin-s/bitcoin-s/pull/827","diff_url":"https://github.com/bitcoin-s/bitcoin-s/pull/827.diff","patch_url":"https://github.com/bitcoin-s/bitcoin-s/pull/827.patch","issue_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/issues/827","number":827,"state":"open","locked":false,"title":"OP_IF Signing","user":{"login":"nkohen","id":22485603,"node_id":"MDQ6VXNlcjIyNDg1NjAz","avatar_url":"https://avatars2.githubusercontent.com/u/22485603?v=4","gravatar_id":"","url":"https://api.github.com/users/nkohen","html_url":"https://github.com/nkohen","followers_url":"https://api.github.com/users/nkohen/followers","following_url":"https://api.github.com/users/nkohen/following{/other_user}","gists_url":"https://api.github.com/users/nkohen/gists{/gist_id}","starred_url":"https://api.github.com/users/nkohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkohen/subscriptions","organizations_url":"https://api.github.com/users/nkohen/orgs","repos_url":"https://api.github.com/users/nkohen/repos","events_url":"https://api.github.com/users/nkohen/events{/privacy}","received_events_url":"https://api.github.com/users/nkohen/received_events","type":"User","site_admin":false},"body":"Adds the `ConditionalScriptPubKey` and `ConditionalScriptSignature` types which allow for non-nested `OP_IF ... OP_ELSE ... OP_ENDIF` scripts and their signing.","created_at":"2019-10-23T21:17:48Z","updated_at":"2019-11-04T12:35:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38daa8a859ef2ace89c8ebe28190556be11136c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1323686553,"node_id":"MDU6TGFiZWwxMzIzNjg2NTUz","url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/labels/core","name":"core","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/827/commits","review_comments_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/827/comments","review_comment_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/issues/827/comments","statuses_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/statuses/208c5cbcf1dc8ae6d96a8182abfc7cc160ac50be","head":{"label":"nkohen:opif_signing","ref":"opif_signing","sha":"208c5cbcf1dc8ae6d96a8182abfc7cc160ac50be","user":{"login":"nkohen","id":22485603,"node_id":"MDQ6VXNlcjIyNDg1NjAz","avatar_url":"https://avatars2.githubusercontent.com/u/22485603?v=4","gravatar_id":"","url":"https://api.github.com/users/nkohen","html_url":"https://github.com/nkohen","followers_url":"https://api.github.com/users/nkohen/followers","following_url":"https://api.github.com/users/nkohen/following{/other_user}","gists_url":"https://api.github.com/users/nkohen/gists{/gist_id}","starred_url":"https://api.github.com/users/nkohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkohen/subscriptions","organizations_url":"https://api.github.com/users/nkohen/orgs","repos_url":"https://api.github.com/users/nkohen/repos","events_url":"https://api.github.com/users/nkohen/events{/privacy}","received_events_url":"https://api.github.com/users/nkohen/received_events","type":"User","site_admin":false},"repo":{"id":134758462,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ3NTg0NjI=","name":"bitcoin-s-core","full_name":"nkohen/bitcoin-s-core","private":false,"owner":{"login":"nkohen","id":22485603,"node_id":"MDQ6VXNlcjIyNDg1NjAz","avatar_url":"https://avatars2.githubusercontent.com/u/22485603?v=4","gravatar_id":"","url":"https://api.github.com/users/nkohen","html_url":"https://github.com/nkohen","followers_url":"https://api.github.com/users/nkohen/followers","following_url":"https://api.github.com/users/nkohen/following{/other_user}","gists_url":"https://api.github.com/users/nkohen/gists{/gist_id}","starred_url":"https://api.github.com/users/nkohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkohen/subscriptions","organizations_url":"https://api.github.com/users/nkohen/orgs","repos_url":"https://api.github.com/users/nkohen/repos","events_url":"https://api.github.com/users/nkohen/events{/privacy}","received_events_url":"https://api.github.com/users/nkohen/received_events","type":"User","site_admin":false},"html_url":"https://github.com/nkohen/bitcoin-s-core","description":"Bitcoin Implementation in Scala (core module)","fork":true,"url":"https://api.github.com/repos/nkohen/bitcoin-s-core","forks_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/forks","keys_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/teams","hooks_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/hooks","issue_events_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/issues/events{/number}","events_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/events","assignees_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/assignees{/user}","branches_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/branches{/branch}","tags_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/tags","blobs_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/statuses/{sha}","languages_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/languages","stargazers_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/stargazers","contributors_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/contributors","subscribers_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/subscribers","subscription_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/subscription","commits_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/contents/{+path}","compare_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/merges","archive_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/downloads","issues_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/issues{/number}","pulls_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/pulls{/number}","milestones_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/milestones{/number}","notifications_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/labels{/name}","releases_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/releases{/id}","deployments_url":"https://api.github.com/repos/nkohen/bitcoin-s-core/deployments","created_at":"2018-05-24T19:13:24Z","updated_at":"2019-11-01T15:05:35Z","pushed_at":"2019-11-01T20:09:56Z","git_url":"git://github.com/nkohen/bitcoin-s-core.git","ssh_url":"git@github.com:nkohen/bitcoin-s-core.git","clone_url":"https://github.com/nkohen/bitcoin-s-core.git","svn_url":"https://github.com/nkohen/bitcoin-s-core","homepage":null,"size":13106,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bitcoin-s:master","ref":"master","sha":"2719eeaecda48a18074fc668b86383dca4acd28d","user":{"login":"bitcoin-s","id":16688471,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Njg4NDcx","avatar_url":"https://avatars1.githubusercontent.com/u/16688471?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin-s","html_url":"https://github.com/bitcoin-s","followers_url":"https://api.github.com/users/bitcoin-s/followers","following_url":"https://api.github.com/users/bitcoin-s/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin-s/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin-s/subscriptions","organizations_url":"https://api.github.com/users/bitcoin-s/orgs","repos_url":"https://api.github.com/users/bitcoin-s/repos","events_url":"https://api.github.com/users/bitcoin-s/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin-s/received_events","type":"Organization","site_admin":false},"repo":{"id":57332261,"node_id":"MDEwOlJlcG9zaXRvcnk1NzMzMjI2MQ==","name":"bitcoin-s","full_name":"bitcoin-s/bitcoin-s","private":false,"owner":{"login":"bitcoin-s","id":16688471,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Njg4NDcx","avatar_url":"https://avatars1.githubusercontent.com/u/16688471?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin-s","html_url":"https://github.com/bitcoin-s","followers_url":"https://api.github.com/users/bitcoin-s/followers","following_url":"https://api.github.com/users/bitcoin-s/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin-s/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin-s/subscriptions","organizations_url":"https://api.github.com/users/bitcoin-s/orgs","repos_url":"https://api.github.com/users/bitcoin-s/repos","events_url":"https://api.github.com/users/bitcoin-s/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin-s/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/bitcoin-s/bitcoin-s","description":"Bitcoin Implementation in Scala","fork":false,"url":"https://api.github.com/repos/bitcoin-s/bitcoin-s","forks_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/forks","keys_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/teams","hooks_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/hooks","issue_events_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/events","assignees_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/tags","blobs_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/languages","stargazers_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/stargazers","contributors_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/contributors","subscribers_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/subscribers","subscription_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/subscription","commits_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/merges","archive_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/downloads","issues_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin-s/bitcoin-s/deployments","created_at":"2016-04-28T20:38:56Z","updated_at":"2019-11-01T14:13:15Z","pushed_at":"2019-11-01T20:09:58Z","git_url":"git://github.com/bitcoin-s/bitcoin-s.git","ssh_url":"git@github.com:bitcoin-s/bitcoin-s.git","clone_url":"https://github.com/bitcoin-s/bitcoin-s.git","svn_url":"https://github.com/bitcoin-s/bitcoin-s","homepage":"https://bitcoin-s.org","size":163583,"stargazers_count":146,"watchers_count":146,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":48,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":127,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":48,"open_issues":127,"watchers":146,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/827"},"html":{"href":"https://github.com/bitcoin-s/bitcoin-s/pull/827"},"issue":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/issues/827"},"comments":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/issues/827/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/827/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/pulls/827/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin-s/bitcoin-s/statuses/208c5cbcf1dc8ae6d96a8182abfc7cc160ac50be"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Christewart"}}